diff options
Diffstat (limited to 'core/input/keycodes.h')
-rw-r--r-- | core/input/keycodes.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/core/input/keycodes.h b/core/input/keycodes.h index 80e2561514..d91465f3be 100644 --- a/core/input/keycodes.h +++ b/core/input/keycodes.h @@ -220,21 +220,28 @@ #define MP_KEY_MODIFIER_META (1<<25) #define MP_KEY_MODIFIER_MASK (MP_KEY_MODIFIER_SHIFT | MP_KEY_MODIFIER_CTRL | \ - MP_KEY_MODIFIER_ALT | MP_KEY_MODIFIER_META) + MP_KEY_MODIFIER_ALT | MP_KEY_MODIFIER_META | \ + MP_KEY_STATE_DOWN | MP_KEY_STATE_UP) // Flag for key events. Multiple down events are idempotent. Release keys by -// sending the key code without this flag, or by sending MP_INPUT_RELEASE_ALL -// as key code. +// sending the key code with KEY_STATE_UP set, or by sending +// MP_INPUT_RELEASE_ALL as key code. #define MP_KEY_STATE_DOWN (1<<26) +// Flag for key events. Releases a key previously held down with +// MP_KEY_STATE_DOWN. Do not sending redundant UP events and do not forget to +// release keys at all with UP. If input is unreliable, use MP_INPUT_RELEASE_ALL +// or don't use MP_KEY_STATE_DOWN in the first place. +#define MP_KEY_STATE_UP (1<<27) + // The following flags are not modifiers, but are part of the keycode itself. // Emit a command even on key-up (normally key-up is ignored). The command // handling code has to ignore unwanted commands specifically. -#define MP_KEY_EMIT_ON_UP (1<<27) +#define MP_KEY_EMIT_ON_UP (1<<28) // Use this when the key shouldn't be auto-repeated (like mouse buttons) // Also means both key-down key-up events produce emit bound commands. -#define MP_NO_REPEAT_KEY (1<<28) +#define MP_NO_REPEAT_KEY (1<<29) #endif /* MPLAYER_KEYCODES_H */ |