private static boolean isTypeValid(int type)
    {
        return type == Listener.TYPE_KEY_PRESSED || type == Listener.TYPE_KEY_RELEASED
                || type == Listener.TYPE_MOUSE_DRAGGED || type == Listener.TYPE_MOUSE_MOVED
                || type == Listener.TYPE_MOUSE_PRESSED || type == Listener.TYPE_MOUSE_RELEASED
                || type == Listener.TYPE_MOUSE_WHEEL;
    }