summaryrefslogtreecommitdiffstats
path: root/core/input/keycodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/input/keycodes.h')
-rw-r--r--core/input/keycodes.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/core/input/keycodes.h b/core/input/keycodes.h
index 92608aa6fa..b086d82809 100644
--- a/core/input/keycodes.h
+++ b/core/input/keycodes.h
@@ -126,7 +126,7 @@
// Mouse events from VOs
-#define MP_MOUSE_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY)
+#define MP_MOUSE_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY|MP_KEY_EMIT_ON_UP)
#define MP_MOUSE_BTN0 (MP_MOUSE_BASE+0)
#define MP_MOUSE_BTN1 (MP_MOUSE_BASE+1)
#define MP_MOUSE_BTN2 (MP_MOUSE_BASE+2)
@@ -149,6 +149,9 @@
#define MP_MOUSE_BTN19 (MP_MOUSE_BASE+19)
#define MP_MOUSE_BTN_END (MP_MOUSE_BASE+20)
+#define MP_KEY_IS_MOUSE_BTN_SINGLE(code) \
+ ((code) >= MP_MOUSE_BASE && (code) < MP_MOUSE_BTN_END)
+
#define MP_MOUSE_BASE_DBL ((MP_KEY_BASE+0xC0)|MP_NO_REPEAT_KEY)
#define MP_MOUSE_BTN0_DBL (MP_MOUSE_BASE_DBL+0)
#define MP_MOUSE_BTN1_DBL (MP_MOUSE_BASE_DBL+1)
@@ -172,6 +175,9 @@
#define MP_MOUSE_BTN19_DBL (MP_MOUSE_BASE_DBL+19)
#define MP_MOUSE_BTN_DBL_END (MP_MOUSE_BASE_DBL+20)
+#define MP_KEY_IS_MOUSE_BTN_DBL(code) \
+ ((code) >= MP_MOUSE_BTN0_DBL && (code) < MP_MOUSE_BTN_DBL_END)
+
// Apple Remote input module
#define MP_AR_BASE (MP_KEY_BASE+0xE0)
#define MP_AR_PLAY (MP_AR_BASE + 0)
@@ -198,6 +204,13 @@
/* Special keys */
#define MP_KEY_INTERN (MP_KEY_BASE+0x1000)
#define MP_KEY_CLOSE_WIN (MP_KEY_INTERN+0)
+// Generated by input.c (VOs use mp_input_set_mouse_pos())
+#define MP_KEY_MOUSE_MOVE ((MP_KEY_INTERN+1)|MP_NO_REPEAT_KEY)
+
+
+#define MP_KEY_DEPENDS_ON_MOUSE_POS(code) \
+ (MP_KEY_IS_MOUSE_BTN_SINGLE(code) || MP_KEY_IS_MOUSE_BTN_DBL(code) || \
+ (code) == MP_KEY_MOUSE_MOVE)
/* Modifiers added to individual keys */
#define MP_KEY_MODIFIER_SHIFT (1<<22)
@@ -208,13 +221,19 @@
#define MP_KEY_MODIFIER_MASK (MP_KEY_MODIFIER_SHIFT | MP_KEY_MODIFIER_CTRL | \
MP_KEY_MODIFIER_ALT | MP_KEY_MODIFIER_META)
-// Use this when the key shouldn't be auto-repeated (like mouse buttons)
-// This is not a modifier, but is part of the keycode itself.
-#define MP_NO_REPEAT_KEY (1<<28)
-
// 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.
-#define MP_KEY_STATE_DOWN (1<<29)
+#define MP_KEY_STATE_DOWN (1<<26)
+
+// 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)
+
+// 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)
#endif /* MPLAYER_KEYCODES_H */