private static int getStart(int type)
    {
        switch (type)
        {
        case TYPE_KEY_PRESSED:
            return key_pressed_start;
        case TYPE_KEY_RELEASED:
            return key_released_start;
        case TYPE_MOUSE_PRESSED:
            return mouse_pressed_start;
        case TYPE_MOUSE_RELEASED:
            return mouse_released_start;
        case TYPE_MOUSE_WHEEL:
            return mouse_wheel_start;
        case TYPE_MOUSE_MOVED:
            return mouse_moved_start;
        case TYPE_MOUSE_DRAGGED:
            return mouse_dragged_start;
        default:
            return -1;
        }
    }