summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-12 01:34:04 +0100
committerwm4 <wm4@nowhere>2013-02-12 10:27:00 +0100
commit75e6584ab3b06a02be37b447c397271c0d120b01 (patch)
treebf912a16b719397df464fde4d46e6b84144a4029 /core
parent3ded26ccba9831ef4b4a2b22f2989fd9d5e72964 (diff)
downloadmpv-75e6584ab3b06a02be37b447c397271c0d120b01.tar.bz2
mpv-75e6584ab3b06a02be37b447c397271c0d120b01.tar.xz
Prefix keycode defines with MP_
Do this to reduce conflicts with <linux/input.h>, which contains some conflicting defines. This changes the meaning of MP_KEY_DOWN: KEY_DOWN is renamed to MP_KEY_DOWN (cursor down key) MP_KEY_DOWN is renamed to MP_KEY_STATE_DOWN (modifier for key down state)
Diffstat (limited to 'core')
-rw-r--r--core/input/appleir.c22
-rw-r--r--core/input/ar.c74
-rw-r--r--core/input/input.c318
-rw-r--r--core/input/joystick.c10
-rw-r--r--core/input/keycodes.h308
-rw-r--r--core/mp_fifo.c12
6 files changed, 366 insertions, 378 deletions
diff --git a/core/input/appleir.c b/core/input/appleir.c
index 4615f1ef9d..e645ba736a 100644
--- a/core/input/appleir.c
+++ b/core/input/appleir.c
@@ -39,8 +39,6 @@
#include "core/mp_msg.h"
-// keycodes.h defines would conflict with linux/input.h ones
-#define AR_DEFINES_ONLY
#include "keycodes.h"
#define EVDEV_MAX_EVENTS 32
@@ -63,16 +61,16 @@ static const struct {
int value;
int mp_keycode;
} apple_ir_mapping[] = {
- { APPLE_IR_PLAY, 1, AR_PLAY },
- { APPLE_IR_PLAY, 2, AR_PLAY_HOLD },
- { APPLE_IR_FORWARD, 1, AR_NEXT },
- { APPLE_IR_FORWARD, 2, AR_NEXT_HOLD },
- { APPLE_IR_BACKWARD, 1, AR_PREV },
- { APPLE_IR_BACKWARD, 2, AR_PREV_HOLD },
- { APPLE_IR_MENU, 1, AR_MENU },
- { APPLE_IR_MENU, 2, AR_MENU_HOLD },
- { APPLE_IR_PLUS, 1, AR_VUP },
- { APPLE_IR_MINUS, 1, AR_VDOWN },
+ { APPLE_IR_PLAY, 1, MP_AR_PLAY },
+ { APPLE_IR_PLAY, 2, MP_AR_PLAY_HOLD },
+ { APPLE_IR_FORWARD, 1, MP_AR_NEXT },
+ { APPLE_IR_FORWARD, 2, MP_AR_NEXT_HOLD },
+ { APPLE_IR_BACKWARD, 1, MP_AR_PREV },
+ { APPLE_IR_BACKWARD, 2, MP_AR_PREV_HOLD },
+ { APPLE_IR_MENU, 1, MP_AR_MENU },
+ { APPLE_IR_MENU, 2, MP_AR_MENU_HOLD },
+ { APPLE_IR_PLUS, 1, MP_AR_VUP },
+ { APPLE_IR_MINUS, 1, MP_AR_VDOWN },
{ -1, -1, -1 }
};
diff --git a/core/input/ar.c b/core/input/ar.c
index 7b7cc8e3db..4dc1c27f5a 100644
--- a/core/input/ar.c
+++ b/core/input/ar.c
@@ -75,30 +75,30 @@ typedef struct cookie_keycode_map {
*/
static const cookie_keycode_map_t ar_codes_tiger[] = {
- { "\x0E\x06\x03\x02", 4, AR_PREV_HOLD },
- { "\x0E\x06\x04\x02", 4, AR_NEXT_HOLD },
- { "\x0E\x06\x0E\x06", 4, AR_MENU_HOLD },
- { "\x0E\x0C\x0B\x06", 4, AR_VUP },
- { "\x0E\x0D\x0B\x06", 4, AR_VDOWN },
- { "\x0E\x07\x06\x0E\x07\x06", 6, AR_MENU },
- { "\x0E\x08\x06\x0E\x08\x06", 6, AR_PLAY },
- { "\x0E\x09\x06\x0E\x09\x06", 6, AR_NEXT },
- { "\x0E\x0A\x06\x0E\x0A\x06", 6, AR_PREV },
- { "\x12\x0E\x06\x12\x0E\x06", 6, AR_PLAY_HOLD },
+ { "\x0E\x06\x03\x02", 4, MP_AR_PREV_HOLD },
+ { "\x0E\x06\x04\x02", 4, MP_AR_NEXT_HOLD },
+ { "\x0E\x06\x0E\x06", 4, MP_AR_MENU_HOLD },
+ { "\x0E\x0C\x0B\x06", 4, MP_AR_VUP },
+ { "\x0E\x0D\x0B\x06", 4, MP_AR_VDOWN },
+ { "\x0E\x07\x06\x0E\x07\x06", 6, MP_AR_MENU },
+ { "\x0E\x08\x06\x0E\x08\x06", 6, MP_AR_PLAY },
+ { "\x0E\x09\x06\x0E\x09\x06", 6, MP_AR_NEXT },
+ { "\x0E\x0A\x06\x0E\x0A\x06", 6, MP_AR_PREV },
+ { "\x12\x0E\x06\x12\x0E\x06", 6, MP_AR_PLAY_HOLD },
{ NULL, 0, MP_INPUT_NOTHING },
};
static const cookie_keycode_map_t ar_codes_leopard[] = {
- { "\x1F\x13\x03\x02", 4, AR_PREV_HOLD },
- { "\x1F\x13\x04\x02", 4, AR_NEXT_HOLD },
- { "\x1F\x13\x1F\x13", 4, AR_MENU_HOLD },
- { "\x1F\x1D\x1C\x13", 4, AR_VUP },
- { "\x1F\x1E\x1C\x13", 4, AR_VDOWN },
- { "\x1F\x14\x13\x1F\x14\x13", 6, AR_MENU },
- { "\x1F\x15\x13\x1F\x15\x13", 6, AR_PLAY },
- { "\x1F\x16\x13\x1F\x16\x13", 6, AR_NEXT },
- { "\x1F\x17\x13\x1F\x17\x13", 6, AR_PREV },
- { "\x23\x1F\x13\x23\x1F\x13", 6, AR_PLAY_HOLD },
+ { "\x1F\x13\x03\x02", 4, MP_AR_PREV_HOLD },
+ { "\x1F\x13\x04\x02", 4, MP_AR_NEXT_HOLD },
+ { "\x1F\x13\x1F\x13", 4, MP_AR_MENU_HOLD },
+ { "\x1F\x1D\x1C\x13", 4, MP_AR_VUP },
+ { "\x1F\x1E\x1C\x13", 4, MP_AR_VDOWN },
+ { "\x1F\x14\x13\x1F\x14\x13", 6, MP_AR_MENU },
+ { "\x1F\x15\x13\x1F\x15\x13", 6, MP_AR_PLAY },
+ { "\x1F\x16\x13\x1F\x16\x13", 6, MP_AR_NEXT },
+ { "\x1F\x17\x13\x1F\x17\x13", 6, MP_AR_PREV },
+ { "\x23\x1F\x13\x23\x1F\x13", 6, MP_AR_PLAY_HOLD },
{ NULL, 0, MP_INPUT_NOTHING },
};
@@ -368,13 +368,13 @@ int mp_input_ar_read(void *ctx, int fd)
ret = ar_code->keycode;
switch (ret) {
// For these 4 keys, the remote can keep a hold state.
- case AR_VUP:
- case AR_VDOWN:
- case AR_NEXT_HOLD:
- case AR_PREV_HOLD:
+ case MP_AR_VUP:
+ case MP_AR_VDOWN:
+ case MP_AR_NEXT_HOLD:
+ case MP_AR_PREV_HOLD:
for (i = cookie_nr-ar_code->seq_len; i < cookie_nr; ++i) {
if (value_queue[i]) {
- down = MP_KEY_DOWN;
+ down = MP_KEY_STATE_DOWN;
break;
}
}
@@ -445,19 +445,19 @@ int main(void)
}
while (1) {
- switch ((ret = mp_input_ar_read(NULL, 0)) & ~MP_KEY_DOWN) {
- case AR_PLAY: printf(" - AR_PLAY."); break;
- case AR_PLAY_HOLD: printf(" - AR_PLAY_HOLD."); break;
- case AR_NEXT: printf(" - AR_NEXT."); break;
- case AR_NEXT_HOLD: printf(" - AR_NEXT_HOLD."); break;
- case AR_PREV: printf(" - AR_PREV."); break;
- case AR_PREV_HOLD: printf(" - AR_PREV_HOLD."); break;
- case AR_MENU: printf(" - AR_MENU."); break;
- case AR_MENU_HOLD: printf(" - AR_MENU_HOLD."); break;
- case AR_VUP: printf(" - AR_VUP."); break;
- case AR_VDOWN: printf(" - AR_VDOWN."); break;
+ switch ((ret = mp_input_ar_read(NULL, 0)) & ~MP_KEY_STATE_DOWN) {
+ case MP_AR_PLAY: printf(" - MP_AR_PLAY."); break;
+ case MP_AR_PLAY_HOLD: printf(" - MP_AR_PLAY_HOLD."); break;
+ case MP_AR_NEXT: printf(" - MP_AR_NEXT."); break;
+ case MP_AR_NEXT_HOLD: printf(" - MP_AR_NEXT_HOLD."); break;
+ case MP_AR_PREV: printf(" - MP_AR_PREV."); break;
+ case MP_AR_PREV_HOLD: printf(" - MP_AR_PREV_HOLD."); break;
+ case MP_AR_MENU: printf(" - MP_AR_MENU."); break;
+ case MP_AR_MENU_HOLD: printf(" - MP_AR_MENU_HOLD."); break;
+ case MP_AR_VUP: printf(" - MP_AR_VUP."); break;
+ case MP_AR_VDOWN: printf(" - MP_AR_VDOWN."); break;
}
- if ((ret > 0 )&&(ret & MP_KEY_DOWN))
+ if ((ret > 0 )&&(ret & MP_KEY_STATE_DOWN))
printf(" [hold]");
if (ret > 0)
printf("\n");
diff --git a/core/input/input.c b/core/input/input.c
index 171909b015..c12dba29b6 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -268,170 +268,168 @@ static const struct legacy_cmd legacy_cmds[] = {
static const struct key_name key_names[] = {
{ ' ', "SPACE" },
{ '#', "SHARP" },
- { KEY_ENTER, "ENTER" },
- { KEY_TAB, "TAB" },
- { KEY_BACKSPACE, "BS" },
- { KEY_DELETE, "DEL" },
- { KEY_INSERT, "INS" },
- { KEY_HOME, "HOME" },
- { KEY_END, "END" },
- { KEY_PAGE_UP, "PGUP" },
- { KEY_PAGE_DOWN, "PGDWN" },
- { KEY_ESC, "ESC" },
- { KEY_PRINT, "PRINT" },
- { KEY_RIGHT, "RIGHT" },
- { KEY_LEFT, "LEFT" },
- { KEY_DOWN, "DOWN" },
- { KEY_UP, "UP" },
- { KEY_F+1, "F1" },
- { KEY_F+2, "F2" },
- { KEY_F+3, "F3" },
- { KEY_F+4, "F4" },
- { KEY_F+5, "F5" },
- { KEY_F+6, "F6" },
- { KEY_F+7, "F7" },
- { KEY_F+8, "F8" },
- { KEY_F+9, "F9" },
- { KEY_F+10, "F10" },
- { KEY_F+11, "F11" },
- { KEY_F+12, "F12" },
- { KEY_KP0, "KP0" },
- { KEY_KP1, "KP1" },
- { KEY_KP2, "KP2" },
- { KEY_KP3, "KP3" },
- { KEY_KP4, "KP4" },
- { KEY_KP5, "KP5" },
- { KEY_KP6, "KP6" },
- { KEY_KP7, "KP7" },
- { KEY_KP8, "KP8" },
- { KEY_KP9, "KP9" },
- { KEY_KPDEL, "KP_DEL" },
- { KEY_KPDEC, "KP_DEC" },
- { KEY_KPINS, "KP_INS" },
- { KEY_KPENTER, "KP_ENTER" },
- { MOUSE_BTN0, "MOUSE_BTN0" },
- { MOUSE_BTN1, "MOUSE_BTN1" },
- { MOUSE_BTN2, "MOUSE_BTN2" },
- { MOUSE_BTN3, "MOUSE_BTN3" },
- { MOUSE_BTN4, "MOUSE_BTN4" },
- { MOUSE_BTN5, "MOUSE_BTN5" },
- { MOUSE_BTN6, "MOUSE_BTN6" },
- { MOUSE_BTN7, "MOUSE_BTN7" },
- { MOUSE_BTN8, "MOUSE_BTN8" },
- { MOUSE_BTN9, "MOUSE_BTN9" },
- { MOUSE_BTN10, "MOUSE_BTN10" },
- { MOUSE_BTN11, "MOUSE_BTN11" },
- { MOUSE_BTN12, "MOUSE_BTN12" },
- { MOUSE_BTN13, "MOUSE_BTN13" },
- { MOUSE_BTN14, "MOUSE_BTN14" },
- { MOUSE_BTN15, "MOUSE_BTN15" },
- { MOUSE_BTN16, "MOUSE_BTN16" },
- { MOUSE_BTN17, "MOUSE_BTN17" },
- { MOUSE_BTN18, "MOUSE_BTN18" },
- { MOUSE_BTN19, "MOUSE_BTN19" },
- { MOUSE_BTN0_DBL, "MOUSE_BTN0_DBL" },
- { MOUSE_BTN1_DBL, "MOUSE_BTN1_DBL" },
- { MOUSE_BTN2_DBL, "MOUSE_BTN2_DBL" },
- { MOUSE_BTN3_DBL, "MOUSE_BTN3_DBL" },
- { MOUSE_BTN4_DBL, "MOUSE_BTN4_DBL" },
- { MOUSE_BTN5_DBL, "MOUSE_BTN5_DBL" },
- { MOUSE_BTN6_DBL, "MOUSE_BTN6_DBL" },
- { MOUSE_BTN7_DBL, "MOUSE_BTN7_DBL" },
- { MOUSE_BTN8_DBL, "MOUSE_BTN8_DBL" },
- { MOUSE_BTN9_DBL, "MOUSE_BTN9_DBL" },
- { MOUSE_BTN10_DBL, "MOUSE_BTN10_DBL" },
- { MOUSE_BTN11_DBL, "MOUSE_BTN11_DBL" },
- { MOUSE_BTN12_DBL, "MOUSE_BTN12_DBL" },
- { MOUSE_BTN13_DBL, "MOUSE_BTN13_DBL" },
- { MOUSE_BTN14_DBL, "MOUSE_BTN14_DBL" },
- { MOUSE_BTN15_DBL, "MOUSE_BTN15_DBL" },
- { MOUSE_BTN16_DBL, "MOUSE_BTN16_DBL" },
- { MOUSE_BTN17_DBL, "MOUSE_BTN17_DBL" },
- { MOUSE_BTN18_DBL, "MOUSE_BTN18_DBL" },
- { MOUSE_BTN19_DBL, "MOUSE_BTN19_DBL" },
- { JOY_AXIS1_MINUS, "JOY_UP" },
- { JOY_AXIS1_PLUS, "JOY_DOWN" },
- { JOY_AXIS0_MINUS, "JOY_LEFT" },
- { JOY_AXIS0_PLUS, "JOY_RIGHT" },
-
- { JOY_AXIS0_PLUS, "JOY_AXIS0_PLUS" },
- { JOY_AXIS0_MINUS, "JOY_AXIS0_MINUS" },
- { JOY_AXIS1_PLUS, "JOY_AXIS1_PLUS" },
- { JOY_AXIS1_MINUS, "JOY_AXIS1_MINUS" },
- { JOY_AXIS2_PLUS, "JOY_AXIS2_PLUS" },
- { JOY_AXIS2_MINUS, "JOY_AXIS2_MINUS" },
- { JOY_AXIS3_PLUS, "JOY_AXIS3_PLUS" },
- { JOY_AXIS3_MINUS, "JOY_AXIS3_MINUS" },
- { JOY_AXIS4_PLUS, "JOY_AXIS4_PLUS" },
- { JOY_AXIS4_MINUS, "JOY_AXIS4_MINUS" },
- { JOY_AXIS5_PLUS, "JOY_AXIS5_PLUS" },
- { JOY_AXIS5_MINUS, "JOY_AXIS5_MINUS" },
- { JOY_AXIS6_PLUS, "JOY_AXIS6_PLUS" },
- { JOY_AXIS6_MINUS, "JOY_AXIS6_MINUS" },
- { JOY_AXIS7_PLUS, "JOY_AXIS7_PLUS" },
- { JOY_AXIS7_MINUS, "JOY_AXIS7_MINUS" },
- { JOY_AXIS8_PLUS, "JOY_AXIS8_PLUS" },
- { JOY_AXIS8_MINUS, "JOY_AXIS8_MINUS" },
- { JOY_AXIS9_PLUS, "JOY_AXIS9_PLUS" },
- { JOY_AXIS9_MINUS, "JOY_AXIS9_MINUS" },
-
- { JOY_BTN0, "JOY_BTN0" },
- { JOY_BTN1, "JOY_BTN1" },
- { JOY_BTN2, "JOY_BTN2" },
- { JOY_BTN3, "JOY_BTN3" },
- { JOY_BTN4, "JOY_BTN4" },
- { JOY_BTN5, "JOY_BTN5" },
- { JOY_BTN6, "JOY_BTN6" },
- { JOY_BTN7, "JOY_BTN7" },
- { JOY_BTN8, "JOY_BTN8" },
- { JOY_BTN9, "JOY_BTN9" },
-
- { AR_PLAY, "AR_PLAY" },
- { AR_PLAY_HOLD, "AR_PLAY_HOLD" },
- { AR_NEXT, "AR_NEXT" },
- { AR_NEXT_HOLD, "AR_NEXT_HOLD" },
- { AR_PREV, "AR_PREV" },
- { AR_PREV_HOLD, "AR_PREV_HOLD" },
- { AR_MENU, "AR_MENU" },
- { AR_MENU_HOLD, "AR_MENU_HOLD" },
- { AR_VUP, "AR_VUP" },
- { AR_VDOWN, "AR_VDOWN" },
-
- { KEY_POWER, "POWER" },
- { KEY_MENU, "MENU" },
- { KEY_PLAY, "PLAY" },
- { KEY_PAUSE, "PAUSE" },
- { KEY_PLAYPAUSE, "PLAYPAUSE" },
- { KEY_STOP, "STOP" },
- { KEY_FORWARD, "FORWARD" },
- { KEY_REWIND, "REWIND" },
- { KEY_NEXT, "NEXT" },
- { KEY_PREV, "PREV" },
- { KEY_VOLUME_UP, "VOLUME_UP" },
- { KEY_VOLUME_DOWN, "VOLUME_DOWN" },
- { KEY_MUTE, "MUTE" },
+ { MP_KEY_ENTER, "ENTER" },
+ { MP_KEY_TAB, "TAB" },
+ { MP_KEY_BACKSPACE, "BS" },
+ { MP_KEY_DELETE, "DEL" },
+ { MP_KEY_INSERT, "INS" },
+ { MP_KEY_HOME, "HOME" },
+ { MP_KEY_END, "END" },
+ { MP_KEY_PAGE_UP, "PGUP" },
+ { MP_KEY_PAGE_DOWN, "PGDWN" },
+ { MP_KEY_ESC, "ESC" },
+ { MP_KEY_PRINT, "PRINT" },
+ { MP_KEY_RIGHT, "RIGHT" },
+ { MP_KEY_LEFT, "LEFT" },
+ { MP_KEY_DOWN, "DOWN" },
+ { MP_KEY_UP, "UP" },
+ { MP_KEY_F+1, "F1" },
+ { MP_KEY_F+2, "F2" },
+ { MP_KEY_F+3, "F3" },
+ { MP_KEY_F+4, "F4" },
+ { MP_KEY_F+5, "F5" },
+ { MP_KEY_F+6, "F6" },
+ { MP_KEY_F+7, "F7" },
+ { MP_KEY_F+8, "F8" },
+ { MP_KEY_F+9, "F9" },
+ { MP_KEY_F+10, "F10" },
+ { MP_KEY_F+11, "F11" },
+ { MP_KEY_F+12, "F12" },
+ { MP_KEY_KP0, "KP0" },
+ { MP_KEY_KP1, "KP1" },
+ { MP_KEY_KP2, "KP2" },
+ { MP_KEY_KP3, "KP3" },
+ { MP_KEY_KP4, "KP4" },
+ { MP_KEY_KP5, "KP5" },
+ { MP_KEY_KP6, "KP6" },
+ { MP_KEY_KP7, "KP7" },
+ { MP_KEY_KP8, "KP8" },
+ { MP_KEY_KP9, "KP9" },
+ { MP_KEY_KPDEL, "KP_DEL" },
+ { MP_KEY_KPDEC, "KP_DEC" },
+ { MP_KEY_KPINS, "KP_INS" },
+ { MP_KEY_KPENTER, "KP_ENTER" },
+ { MP_MOUSE_BTN0, "MOUSE_BTN0" },
+ { MP_MOUSE_BTN1, "MOUSE_BTN1" },
+ { MP_MOUSE_BTN2, "MOUSE_BTN2" },
+ { MP_MOUSE_BTN3, "MOUSE_BTN3" },
+ { MP_MOUSE_BTN4, "MOUSE_BTN4" },
+ { MP_MOUSE_BTN5, "MOUSE_BTN5" },
+ { MP_MOUSE_BTN6, "MOUSE_BTN6" },
+ { MP_MOUSE_BTN7, "MOUSE_BTN7" },
+ { MP_MOUSE_BTN8, "MOUSE_BTN8" },
+ { MP_MOUSE_BTN9, "MOUSE_BTN9" },
+ { MP_MOUSE_BTN10, "MOUSE_BTN10" },
+ { MP_MOUSE_BTN11, "MOUSE_BTN11" },
+ { MP_MOUSE_BTN12, "MOUSE_BTN12" },
+ { MP_MOUSE_BTN13, "MOUSE_BTN13" },
+ { MP_MOUSE_BTN14, "MOUSE_BTN14" },
+ { MP_MOUSE_BTN15, "MOUSE_BTN15" },
+ { MP_MOUSE_BTN16, "MOUSE_BTN16" },
+ { MP_MOUSE_BTN17, "MOUSE_BTN17" },
+ { MP_MOUSE_BTN18, "MOUSE_BTN18" },
+ { MP_MOUSE_BTN19, "MOUSE_BTN19" },
+ { MP_MOUSE_BTN0_DBL, "MOUSE_BTN0_DBL" },
+ { MP_MOUSE_BTN1_DBL, "MOUSE_BTN1_DBL" },
+ { MP_MOUSE_BTN2_DBL, "MOUSE_BTN2_DBL" },
+ { MP_MOUSE_BTN3_DBL, "MOUSE_BTN3_DBL" },
+ { MP_MOUSE_BTN4_DBL, "MOUSE_BTN4_DBL" },
+ { MP_MOUSE_BTN5_DBL, "MOUSE_BTN5_DBL" },
+ { MP_MOUSE_BTN6_DBL, "MOUSE_BTN6_DBL" },
+ { MP_MOUSE_BTN7_DBL, "MOUSE_BTN7_DBL" },
+ { MP_MOUSE_BTN8_DBL, "MOUSE_BTN8_DBL" },
+ { MP_MOUSE_BTN9_DBL, "MOUSE_BTN9_DBL" },
+ { MP_MOUSE_BTN10_DBL, "MOUSE_BTN10_DBL" },
+ { MP_MOUSE_BTN11_DBL, "MOUSE_BTN11_DBL" },
+ { MP_MOUSE_BTN12_DBL, "MOUSE_BTN12_DBL" },
+ { MP_MOUSE_BTN13_DBL, "MOUSE_BTN13_DBL" },
+ { MP_MOUSE_BTN14_DBL, "MOUSE_BTN14_DBL" },
+ { MP_MOUSE_BTN15_DBL, "MOUSE_BTN15_DBL" },
+ { MP_MOUSE_BTN16_DBL, "MOUSE_BTN16_DBL" },
+ { MP_MOUSE_BTN17_DBL, "MOUSE_BTN17_DBL" },
+ { MP_MOUSE_BTN18_DBL, "MOUSE_BTN18_DBL" },
+ { MP_MOUSE_BTN19_DBL, "MOUSE_BTN19_DBL" },
+ { MP_JOY_AXIS1_MINUS, "JOY_UP" },
+ { MP_JOY_AXIS1_PLUS, "JOY_DOWN" },
+ { MP_JOY_AXIS0_MINUS, "JOY_LEFT" },
+ { MP_JOY_AXIS0_PLUS, "JOY_RIGHT" },
+
+ { MP_JOY_AXIS0_PLUS, "JOY_AXIS0_PLUS" },
+ { MP_JOY_AXIS0_MINUS, "JOY_AXIS0_MINUS" },
+ { MP_JOY_AXIS1_PLUS, "JOY_AXIS1_PLUS" },
+ { MP_JOY_AXIS1_MINUS, "JOY_AXIS1_MINUS" },
+ { MP_JOY_AXIS2_PLUS, "JOY_AXIS2_PLUS" },
+ { MP_JOY_AXIS2_MINUS, "JOY_AXIS2_MINUS" },
+ { MP_JOY_AXIS3_PLUS, "JOY_AXIS3_PLUS" },
+ { MP_JOY_AXIS3_MINUS, "JOY_AXIS3_MINUS" },
+ { MP_JOY_AXIS4_PLUS, "JOY_AXIS4_PLUS" },
+ { MP_JOY_AXIS4_MINUS, "JOY_AXIS4_MINUS" },
+ { MP_JOY_AXIS5_PLUS, "JOY_AXIS5_PLUS" },
+ { MP_JOY_AXIS5_MINUS, "JOY_AXIS5_MINUS" },
+ { MP_JOY_AXIS6_PLUS, "JOY_AXIS6_PLUS" },
+ { MP_JOY_AXIS6_MINUS, "JOY_AXIS6_MINUS" },
+ { MP_JOY_AXIS7_PLUS, "JOY_AXIS7_PLUS" },
+ { MP_JOY_AXIS7_MINUS, "JOY_AXIS7_MINUS" },
+ { MP_JOY_AXIS8_PLUS, "JOY_AXIS8_PLUS" },
+ { MP_JOY_AXIS8_MINUS, "JOY_AXIS8_MINUS" },
+ { MP_JOY_AXIS9_PLUS, "JOY_AXIS9_PLUS" },
+ { MP_JOY_AXIS9_MINUS, "JOY_AXIS9_MINUS" },
+
+ { MP_JOY_BTN0, "JOY_BTN0" },
+ { MP_JOY_BTN1, "JOY_BTN1" },
+ { MP_JOY_BTN2, "JOY_BTN2" },
+ { MP_JOY_BTN3, "JOY_BTN3" },
+ { MP_JOY_BTN4, "JOY_BTN4" },
+ { MP_JOY_BTN5, "JOY_BTN5" },
+ { MP_JOY_BTN6, "JOY_BTN6" },
+ { MP_JOY_BTN7, "JOY_BTN7" },
+ { MP_JOY_BTN8, "JOY_BTN8" },
+ { MP_JOY_BTN9, "JOY_BTN9" },
+
+ { MP_AR_PLAY, "AR_PLAY" },
+ { MP_AR_PLAY_HOLD, "AR_PLAY_HOLD" },
+ { MP_AR_NEXT, "AR_NEXT" },
+ { MP_AR_NEXT_HOLD, "AR_NEXT_HOLD" },
+ { MP_AR_PREV, "AR_PREV" },
+ { MP_AR_PREV_HOLD, "AR_PREV_HOLD" },
+ { MP_AR_MENU, "AR_MENU" },
+ { MP_AR_MENU_HOLD, "AR_MENU_HOLD" },
+ { MP_AR_VUP, "AR_VUP" },
+ { MP_AR_VDOWN, "AR_VDOWN" },
+
+ { MP_KEY_POWER, "POWER" },
+ { MP_KEY_MENU, "MENU" },
+ { MP_KEY_PLAY, "PLAY" },
+ { MP_KEY_PAUSE, "PAUSE" },
+ { MP_KEY_PLAYPAUSE, "PLAYPAUSE" },
+ { MP_KEY_STOP, "STOP" },
+ { MP_KEY_FORWARD, "FORWARD" },
+ { MP_KEY_REWIND, "REWIND" },
+ { MP_KEY_NEXT, "NEXT" },
+ { MP_KEY_PREV, "PREV" },
+ { MP_KEY_VOLUME_UP, "VOLUME_UP" },
+ { MP_KEY_VOLUME_DOWN, "VOLUME_DOWN" },
+ { MP_KEY_MUTE, "MUTE" },
// These are kept for backward compatibility
- { KEY_PAUSE, "XF86_PAUSE" },
- { KEY_STOP, "XF86_STOP" },
- { KEY_PREV, "XF86_PREV" },
- { KEY_NEXT, "XF86_NEXT" },
+ { MP_KEY_PAUSE, "XF86_PAUSE" },
+ { MP_KEY_STOP, "XF86_STOP" },
+ { MP_KEY_PREV, "XF86_PREV" },
+ { MP_KEY_NEXT, "XF86_NEXT" },
- { KEY_CLOSE_WIN, "CLOSE_WIN" },
+ { MP_KEY_CLOSE_WIN, "CLOSE_WIN" },
{ 0, NULL }
};
struct key_name modifier_names[] = {
- { KEY_MODIFIER_SHIFT, "Shift" },
- { KEY_MODIFIER_CTRL, "Ctrl" },
- { KEY_MODIFIER_ALT, "Alt" },
- { KEY_MODIFIER_META, "Meta" },
+ { MP_KEY_MODIFIER_SHIFT, "Shift" },
+ { MP_KEY_MODIFIER_CTRL, "Ctrl" },
+ { MP_KEY_MODIFIER_ALT, "Alt" },
+ { MP_KEY_MODIFIER_META, "Meta" },
{ 0 }
};
-#define KEY_MODIFIER_MASK (KEY_MODIFIER_SHIFT | KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT | KEY_MODIFIER_META)
-
#ifndef MP_MAX_KEY_FD
#define MP_MAX_KEY_FD 10
#endif
@@ -1252,17 +1250,17 @@ static mp_cmd_t *interpret_key(struct input_ctx *ictx, int code)
* we want to have "a" and "A" instead of "a" and "Shift+A"; but a separate
* shift modifier is still kept for special keys like arrow keys.
*/
- int unmod = code & ~KEY_MODIFIER_MASK;
+ int unmod = code & ~MP_KEY_MODIFIER_MASK;
if (unmod >= 32 && unmod < MP_KEY_BASE)
- code &= ~KEY_MODIFIER_SHIFT;
+ code &= ~MP_KEY_MODIFIER_SHIFT;
- if (code & MP_KEY_DOWN) {
+ if (code & MP_KEY_STATE_DOWN) {
if (ictx->num_key_down >= MP_MAX_KEY_DOWN) {
mp_tmsg(MSGT_INPUT, MSGL_ERR, "Too many key down events "
"at the same time\n");
return NULL;
}
- code &= ~MP_KEY_DOWN;
+ code &= ~MP_KEY_STATE_DOWN;
// Check if we don't already have this key as pushed
for (j = 0; j < ictx->num_key_down; j++) {
if (ictx->key_down[j] == code)
@@ -1281,9 +1279,9 @@ static mp_cmd_t *interpret_key(struct input_ctx *ictx, int code)
if (ictx->key_down[j] == code)
break;
}
- bool doubleclick = code >= MOUSE_BTN0_DBL && code < MOUSE_BTN_DBL_END;
+ bool doubleclick = code >= MP_MOUSE_BTN0_DBL && code < MP_MOUSE_BTN_DBL_END;
if (doubleclick) {
- int btn = code - MOUSE_BTN0_DBL + MOUSE_BTN0;
+ int btn = code - MP_MOUSE_BTN0_DBL + MP_MOUSE_BTN0;
if (!ictx->num_key_down
|| ictx->key_down[ictx->num_key_down - 1] != btn)
return NULL;
@@ -1305,7 +1303,7 @@ static mp_cmd_t *interpret_key(struct input_ctx *ictx, int code)
get_cmd_from_keys(ictx, ictx->num_key_down, ictx->key_down)
: NULL;
if (doubleclick) {
- ictx->key_down[j] = code - MOUSE_BTN0_DBL + MOUSE_BTN0;
+ ictx->key_down[j] = code - MP_MOUSE_BTN0_DBL + MP_MOUSE_BTN0;
return ret;
}
// Remove the key
diff --git a/core/input/joystick.c b/core/input/joystick.c
index ae2bf7990b..17b4279c39 100644
--- a/core/input/joystick.c
+++ b/core/input/joystick.c
@@ -137,18 +137,18 @@ int mp_input_joystick_read(void *ctx, int fd) {
btns &= ~(1 << ev.number);
btns |= (ev.value << ev.number);
if(ev.value == 1)
- return (JOY_BTN0 + ev.number) | MP_KEY_DOWN;
+ return (MP_JOY_BTN0 + ev.number) | MP_KEY_STATE_DOWN;
else
- return JOY_BTN0 + ev.number;
+ return MP_JOY_BTN0 + ev.number;
} else if(ev.type & JS_EVENT_AXIS) {
if(ev.value < -JOY_AXIS_DELTA && axis[ev.number] != -1) {
axis[ev.number] = -1;
- return (JOY_AXIS0_MINUS+(2*ev.number)) | MP_KEY_DOWN;
+ return (MP_JOY_AXIS0_MINUS+(2*ev.number)) | MP_KEY_STATE_DOWN;
} else if(ev.value > JOY_AXIS_DELTA && axis[ev.number] != 1) {
axis[ev.number] = 1;
- return (JOY_AXIS0_PLUS+(2*ev.number)) | MP_KEY_DOWN;
+ return (MP_JOY_AXIS0_PLUS+(2*ev.number)) | MP_KEY_STATE_DOWN;
} else if(ev.value <= JOY_AXIS_DELTA && ev.value >= -JOY_AXIS_DELTA && axis[ev.number] != 0) {
- int r = axis[ev.number] == 1 ? JOY_AXIS0_PLUS+(2*ev.number) : JOY_AXIS0_MINUS+(2*ev.number);
+ int r = axis[ev.number] == 1 ? MP_JOY_AXIS0_PLUS+(2*ev.number) : MP_JOY_AXIS0_MINUS+(2*ev.number);
axis[ev.number] = 0;
return r;
} else
diff --git a/core/input/keycodes.h b/core/input/keycodes.h
index c86a4bc138..18ce7ce1cc 100644
--- a/core/input/keycodes.h
+++ b/core/input/keycodes.h
@@ -23,192 +23,184 @@
#define MP_KEY_BASE (1<<21)
-// For appleir.c which includes another header with KEY_ENTER etc defines
-#ifndef AR_DEFINES_ONLY
-
-#define KEY_ENTER 13
-#define KEY_TAB 9
+#define MP_KEY_ENTER 13
+#define MP_KEY_TAB 9
/* Control keys */
-#define KEY_BACKSPACE (MP_KEY_BASE+0)
-#define KEY_DELETE (MP_KEY_BASE+1)
-#define KEY_INSERT (MP_KEY_BASE+2)
-#define KEY_HOME (MP_KEY_BASE+3)
-#define KEY_END (MP_KEY_BASE+4)
-#define KEY_PAGE_UP (MP_KEY_BASE+5)
-#define KEY_PAGE_DOWN (MP_KEY_BASE+6)
-#define KEY_ESC (MP_KEY_BASE+7)
-#define KEY_PRINT (MP_KEY_BASE+8)
+#define MP_KEY_BACKSPACE (MP_KEY_BASE+0)
+#define MP_KEY_DELETE (MP_KEY_BASE+1)
+#define MP_KEY_INSERT (MP_KEY_BASE+2)
+#define MP_KEY_HOME (MP_KEY_BASE+3)
+#define MP_KEY_END (MP_KEY_BASE+4)
+#define MP_KEY_PAGE_UP (MP_KEY_BASE+5)
+#define MP_KEY_PAGE_DOWN (MP_KEY_BASE+6)
+#define MP_KEY_ESC (MP_KEY_BASE+7)
+#define MP_KEY_PRINT (MP_KEY_BASE+8)
/* Control keys short name */
-#define KEY_BS KEY_BACKSPACE
-#define KEY_DEL KEY_DELETE
-#define KEY_INS KEY_INSERT
-#define KEY_PGUP KEY_PAGE_UP
-#define KEY_PGDOWN KEY_PAGE_DOWN
-#define KEY_PGDWN KEY_PAGE_DOWN
+#define MP_KEY_BS MP_KEY_BACKSPACE
+#define MP_KEY_DEL MP_KEY_DELETE
+#define MP_KEY_INS MP_KEY_INSERT
+#define MP_KEY_PGUP MP_KEY_PAGE_UP
+#define MP_KEY_PGDOWN MP_KEY_PAGE_DOWN
+#define MP_KEY_PGDWN MP_KEY_PAGE_DOWN
/* Cursor movement */
-#define KEY_CRSR (MP_KEY_BASE+0x10)
-#define KEY_RIGHT (KEY_CRSR+0)
-#define KEY_LEFT (KEY_CRSR+1)
-#define KEY_DOWN (KEY_CRSR+2)
-#define KEY_UP (KEY_CRSR+3)
+#define MP_KEY_CRSR (MP_KEY_BASE+0x10)
+#define MP_KEY_RIGHT (MP_KEY_CRSR+0)
+#define MP_KEY_LEFT (MP_KEY_CRSR+1)
+#define MP_KEY_DOWN (MP_KEY_CRSR+2)
+#define MP_KEY_UP (MP_KEY_CRSR+3)
/* Multimedia keyboard/remote keys */
-#define KEY_MM_BASE (MP_KEY_BASE+0x20)
-#define KEY_POWER (KEY_MM_BASE+0)
-#define KEY_MENU (KEY_MM_BASE+1)
-#define KEY_PLAY (KEY_MM_BASE+2)
-#define KEY_PAUSE (KEY_MM_BASE+3)
-#define KEY_PLAYPAUSE (KEY_MM_BASE+4)
-#define KEY_STOP (KEY_MM_BASE+5)
-#define KEY_FORWARD (KEY_MM_BASE+6)
-#define KEY_REWIND (KEY_MM_BASE+7)
-#define KEY_NEXT (KEY_MM_BASE+8)
-#define KEY_PREV (KEY_MM_BASE+9)
-#define KEY_VOLUME_UP (KEY_MM_BASE+10)
-#define KEY_VOLUME_DOWN (KEY_MM_BASE+11)
-#define KEY_MUTE (KEY_MM_BASE+12)
+#define MP_KEY_MM_BASE (MP_KEY_BASE+0x20)
+#define MP_KEY_POWER (MP_KEY_MM_BASE+0)
+#define MP_KEY_MENU (MP_KEY_MM_BASE+1)
+#define MP_KEY_PLAY (MP_KEY_MM_BASE+2)
+#define MP_KEY_PAUSE (MP_KEY_MM_BASE+3)
+#define MP_KEY_PLAYPAUSE (MP_KEY_MM_BASE+4)
+#define MP_KEY_STOP (MP_KEY_MM_BASE+5)
+#define MP_KEY_FORWARD (MP_KEY_MM_BASE+6)
+#define MP_KEY_REWIND (MP_KEY_MM_BASE+7)
+#define MP_KEY_NEXT (MP_KEY_MM_BASE+8)
+#define MP_KEY_PREV (MP_KEY_MM_BASE+9)
+#define MP_KEY_VOLUME_UP (MP_KEY_MM_BASE+10)
+#define MP_KEY_VOLUME_DOWN (MP_KEY_MM_BASE+11)
+#define MP_KEY_MUTE (MP_KEY_MM_BASE+12)
/* Function keys */
-#define KEY_F (MP_KEY_BASE+0x40)
+#define MP_KEY_F (MP_KEY_BASE+0x40)
/* Keypad keys */
-#define KEY_KEYPAD (MP_KEY_BASE+0x60)
-#define KEY_KP0 (KEY_KEYPAD+0)
-#define KEY_KP1 (KEY_KEYPAD+1)
-#define KEY_KP2 (KEY_KEYPAD+2)
-#define KEY_KP3 (KEY_KEYPAD+3)
-#define KEY_KP4 (KEY_KEYPAD+4)
-#define KEY_KP5 (KEY_KEYPAD+5)
-#define KEY_KP6 (KEY_KEYPAD+6)
-#define KEY_KP7 (KEY_KEYPAD+7)
-#define KEY_KP8 (KEY_KEYPAD+8)
-#define KEY_KP9 (KEY_KEYPAD+9)
-#define KEY_KPDEC (KEY_KEYPAD+10)
-#define KEY_KPINS (KEY_KEYPAD+11)
-#define KEY_KPDEL (KEY_KEYPAD+12)
-#define KEY_KPENTER (KEY_KEYPAD+13)
+#define MP_KEY_KEYPAD (MP_KEY_BASE+0x60)
+#define MP_KEY_KP0 (MP_KEY_KEYPAD+0)
+#define MP_KEY_KP1 (MP_KEY_KEYPAD+1)
+#define MP_KEY_KP2 (MP_KEY_KEYPAD+2)
+#define MP_KEY_KP3 (MP_KEY_KEYPAD+3)
+#define MP_KEY_KP4 (MP_KEY_KEYPAD+4)
+#define MP_KEY_KP5 (MP_KEY_KEYPAD+5)
+#define MP_KEY_KP6 (MP_KEY_KEYPAD+6)
+#define MP_KEY_KP7 (MP_KEY_KEYPAD+7)
+#define MP_KEY_KP8 (MP_KEY_KEYPAD+8)
+#define MP_KEY_KP9 (MP_KEY_KEYPAD+9)
+#define MP_KEY_KPDEC (MP_KEY_KEYPAD+10)
+#define MP_KEY_KPINS (MP_KEY_KEYPAD+11)
+#define MP_KEY_KPDEL (MP_KEY_KEYPAD+12)
+#define MP_KEY_KPENTER (MP_KEY_KEYPAD+13)
// Joystick input module
-#define JOY_BASE (MP_KEY_BASE+0x70)
-#define JOY_AXIS0_PLUS (JOY_BASE+0)
-#define JOY_AXIS0_MINUS (JOY_BASE+1)
-#define JOY_AXIS1_PLUS (JOY_BASE+2)
-#define JOY_AXIS1_MINUS (JOY_BASE+3)
-#define JOY_AXIS2_PLUS (JOY_BASE+4)
-#define JOY_AXIS2_MINUS (JOY_BASE+5)
-#define JOY_AXIS3_PLUS (JOY_BASE+6)
-#define JOY_AXIS3_MINUS (JOY_BASE+7)
-#define JOY_AXIS4_PLUS (JOY_BASE+8)
-#define JOY_AXIS4_MINUS (JOY_BASE+9)
-#define JOY_AXIS5_PLUS (JOY_BASE+10)
-#define JOY_AXIS5_MINUS (JOY_BASE+11)
-#define JOY_AXIS6_PLUS (JOY_BASE+12)
-#define JOY_AXIS6_MINUS (JOY_BASE+13)
-#define JOY_AXIS7_PLUS (JOY_BASE+14)
-#define JOY_AXIS7_MINUS (JOY_BASE+15)
-#define JOY_AXIS8_PLUS (JOY_BASE+16)
-#define JOY_AXIS8_MINUS (JOY_BASE+17)
-#define JOY_AXIS9_PLUS (JOY_BASE+18)
-#define JOY_AXIS9_MINUS (JOY_BASE+19)
-
-#define JOY_BTN_BASE ((MP_KEY_BASE+0x90)|MP_NO_REPEAT_KEY)
-#define JOY_BTN0 (JOY_BTN_BASE+0)
-#define JOY_BTN1 (JOY_BTN_BASE+1)
-#define JOY_BTN2 (JOY_BTN_BASE+2)
-#define JOY_BTN3 (JOY_BTN_BASE+3)
-#define JOY_BTN4 (JOY_BTN_BASE+4)
-#define JOY_BTN5 (JOY_BTN_BASE+5)
-#define JOY_BTN6 (JOY_BTN_BASE+6)
-#define JOY_BTN7 (JOY_BTN_BASE+7)
-#define JOY_BTN8 (JOY_BTN_BASE+8)
-#define JOY_BTN9 (JOY_BTN_BASE+9)
+#define MP_JOY_BASE (MP_KEY_BASE+0x70)
+#define MP_JOY_AXIS0_PLUS (MP_JOY_BASE+0)
+#define MP_JOY_AXIS0_MINUS (MP_JOY_BASE+1)
+#define MP_JOY_AXIS1_PLUS (MP_JOY_BASE+2)
+#define MP_JOY_AXIS1_MINUS (MP_JOY_BASE+3)
+#define MP_JOY_AXIS2_PLUS (MP_JOY_BASE+4)
+#define MP_JOY_AXIS2_MINUS (MP_JOY_BASE+5)
+#define MP_JOY_AXIS3_PLUS (MP_JOY_BASE+6)
+#define MP_JOY_AXIS3_MINUS (MP_JOY_BASE+7)
+#define MP_JOY_AXIS4_PLUS (MP_JOY_BASE+8)
+#define MP_JOY_AXIS4_MINUS (MP_JOY_BASE+9)
+#define MP_JOY_AXIS5_PLUS (MP_JOY_BASE+10)
+#define MP_JOY_AXIS5_MINUS (MP_JOY_BASE+11)
+#define MP_JOY_AXIS6_PLUS (MP_JOY_BASE+12)
+#define MP_JOY_AXIS6_MINUS (MP_JOY_BASE+13)
+#define MP_JOY_AXIS7_PLUS (MP_JOY_BASE+14)
+#define MP_JOY_AXIS7_MINUS (MP_JOY_BASE+15)
+#define MP_JOY_AXIS8_PLUS (MP_JOY_BASE+16)
+#define MP_JOY_AXIS8_MINUS (MP_JOY_BASE+17)
+#define MP_JOY_AXIS9_PLUS (MP_JOY_BASE+18)
+#define MP_JOY_AXIS9_MINUS (MP_JOY_BASE+19)
+
+#define MP_JOY_BTN_BASE ((MP_KEY_BASE+0x90)|MP_NO_REPEAT_KEY)
+#define MP_JOY_BTN0 (MP_JOY_BTN_BASE+0)
+#define MP_JOY_BTN1 (MP_JOY_BTN_BASE+1)
+#define MP_JOY_BTN2 (MP_JOY_BTN_BASE+2)
+#define MP_JOY_BTN3 (MP_JOY_BTN_BASE+3)
+#define MP_JOY_BTN4 (MP_JOY_BTN_BASE+4)
+#define MP_JOY_BTN5 (MP_JOY_BTN_BASE+5)
+#define MP_JOY_BTN6 (MP_JOY_BTN_BASE+6)
+#define MP_JOY_BTN7 (MP_JOY_BTN_BASE+7)
+#define MP_JOY_BTN8 (MP_JOY_BTN_BASE+8)
+#define MP_JOY_BTN9 (MP_JOY_BTN_BASE+9)
// Mouse events from VOs
-#define MOUSE_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY)
-#define MOUSE_BTN0 (MOUSE_BASE+0)
-#define MOUSE_BTN1 (MOUSE_BASE+1)
-#define MOUSE_BTN2 (MOUSE_BASE+2)
-#define MOUSE_BTN3 (MOUSE_BASE+3)
-#define MOUSE_BTN4 (MOUSE_BASE+4)
-#define MOUSE_BTN5 (MOUSE_BASE+5)
-#define MOUSE_BTN6 (MOUSE_BASE+6)
-#define MOUSE_BTN7 (MOUSE_BASE+7)
-#define MOUSE_BTN8 (MOUSE_BASE+8)
-#define MOUSE_BTN9 (MOUSE_BASE+9)
-#define MOUSE_BTN10 (MOUSE_BASE+10)
-#define MOUSE_BTN11 (MOUSE_BASE+11)
-#define MOUSE_BTN12 (MOUSE_BASE+12)
-#define MOUSE_BTN13 (MOUSE_BASE+13)
-#define MOUSE_BTN14 (MOUSE_BASE+14)
-#define MOUSE_BTN15 (MOUSE_BASE+15)
-#define MOUSE_BTN16 (MOUSE_BASE+16)
-#define MOUSE_BTN17 (MOUSE_BASE+17)
-#define MOUSE_BTN18 (MOUSE_BASE+18)
-#define MOUSE_BTN19 (MOUSE_BASE+19)
-#define MOUSE_BTN_END (MOUSE_BASE+20)
-
-#define MOUSE_BASE_DBL ((MP_KEY_BASE+0xC0)|MP_NO_REPEAT_KEY)
-#define MOUSE_BTN0_DBL (MOUSE_BASE_DBL+0)
-#define MOUSE_BTN1_DBL (MOUSE_BASE_DBL+1)
-#define MOUSE_BTN2_DBL (MOUSE_BASE_DBL+2)
-#define MOUSE_BTN3_DBL (MOUSE_BASE_DBL+3)
-#define MOUSE_BTN4_DBL (MOUSE_BASE_DBL+4)
-#define MOUSE_BTN5_DBL (MOUSE_BASE_DBL+5)
-#define MOUSE_BTN6_DBL (MOUSE_BASE_DBL+6)
-#define MOUSE_BTN7_DBL (MOUSE_BASE_DBL+7)
-#define MOUSE_BTN8_DBL (MOUSE_BASE_DBL+8)
-#define MOUSE_BTN9_DBL (MOUSE_BASE_DBL+9)
-#define MOUSE_BTN10_DBL (MOUSE_BASE_DBL+10)
-#define MOUSE_BTN11_DBL (MOUSE_BASE_DBL+11)
-#define MOUSE_BTN12_DBL (MOUSE_BASE_DBL+12)
-#define MOUSE_BTN13_DBL (MOUSE_BASE_DBL+13)
-#define MOUSE_BTN14_DBL (MOUSE_BASE_DBL+14)
-#define MOUSE_BTN15_DBL (MOUSE_BASE_DBL+15)
-#define MOUSE_BTN16_DBL (MOUSE_BASE_DBL+16)
-#define MOUSE_BTN17_DBL (MOUSE_BASE_DBL+17)
-#define MOUSE_BTN18_DBL (MOUSE_BASE_DBL+18)
-#define MOUSE_BTN19_DBL (MOUSE_BASE_DBL+19)
-#define MOUSE_BTN_DBL_END (MOUSE_BASE_DBL+20)
-
-
-#endif // AR_DEFINES_ONLY
+#define MP_MOUSE_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY)
+#define MP_MOUSE_BTN0 (MP_MOUSE_BASE+0)
+#define MP_MOUSE_BTN1 (MP_MOUSE_BASE+1)
+#define MP_MOUSE_BTN2 (MP_MOUSE_BASE+2)
+#define MP_MOUSE_BTN3 (MP_MOUSE_BASE+3)
+#define MP_MOUSE_BTN4 (MP_MOUSE_BASE+4)
+#define MP_MOUSE_BTN5 (MP_MOUSE_BASE+5)
+#define MP_MOUSE_BTN6 (MP_MOUSE_BASE+6)
+#define MP_MOUSE_BTN7 (MP_MOUSE_BASE+7)
+#define MP_MOUSE_BTN8 (MP_MOUSE_BASE+8)
+#define MP_MOUSE_BTN9 (MP_MOUSE_BASE+9)
+#define MP_MOUSE_BTN10 (MP_MOUSE_BASE+10)
+#define MP_MOUSE_BTN11 (MP_MOUSE_BASE+11)
+#define MP_MOUSE_BTN12 (MP_MOUSE_BASE+12)
+#define MP_MOUSE_BTN13 (MP_MOUSE_BASE+13)
+#define MP_MOUSE_BTN14 (MP_MOUSE_BASE+14)
+#define MP_MOUSE_BTN15 (MP_MOUSE_BASE+15)
+#define MP_MOUSE_BTN16 (MP_MOUSE_BASE+16)
+#define MP_MOUSE_BTN17 (MP_MOUSE_BASE+17)
+#define MP_MOUSE_BTN18 (MP_MOUSE_BASE+18)
+#define MP_MOUSE_BTN19 (MP_MOUSE_BASE+19)
+#define MP_MOUSE_BTN_END (MP_MOUSE_BASE+20)
+
+#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)
+#define MP_MOUSE_BTN2_DBL (MP_MOUSE_BASE_DBL+2)
+#define MP_MOUSE_BTN3_DBL (MP_MOUSE_BASE_DBL+3)
+#define MP_MOUSE_BTN4_DBL (MP_MOUSE_BASE_DBL+4)
+#define MP_MOUSE_BTN5_DBL (MP_MOUSE_BASE_DBL+5)
+#define MP_MOUSE_BTN6_DBL (MP_MOUSE_BASE_DBL+6)
+#define MP_MOUSE_BTN7_DBL (MP_MOUSE_BASE_DBL+7)
+#define MP_MOUSE_BTN8_DBL (MP_MOUSE_BASE_DBL+8)
+#define MP_MOUSE_BTN9_DBL (MP_MOUSE_BASE_DBL+9)
+#define MP_MOUSE_BTN10_DBL (MP_MOUSE_BASE_DBL+10)
+#define MP_MOUSE_BTN11_DBL (MP_MOUSE_BASE_DBL+11)
+#define MP_MOUSE_BTN12_DBL (MP_MOUSE_BASE_DBL+12)
+#define MP_MOUSE_BTN13_DBL (MP_MOUSE_BASE_DBL+13)
+#define MP_MOUSE_BTN14_DBL (MP_MOUSE_BASE_DBL+14)
+#define MP_MOUSE_BTN15_DBL (MP_MOUSE_BASE_DBL+15)
+#define MP_MOUSE_BTN16_DBL (MP_MOUSE_BASE_DBL+16)
+#define MP_MOUSE_BTN17_DBL (MP_MOUSE_BASE_DBL+17)
+#define MP_MOUSE_BTN18_DBL (MP_MOUSE_BASE_DBL+18)
+#define MP_MOUSE_BTN19_DBL (MP_MOUSE_BASE_DBL+19)
+#define MP_MOUSE_BTN_DBL_END (MP_MOUSE_BASE_DBL+20)
// Apple Remote input module
-#define AR_BASE (MP_KEY_BASE+0xE0)
-#define AR_PLAY (AR_BASE + 0)
-#define AR_PLAY_HOLD (AR_BASE + 1)
-#define AR_NEXT (AR_BASE + 2)
-#define AR_NEXT_HOLD (AR_BASE + 3)
-#define AR_PREV (AR_BASE + 4)
-#define AR_PREV_HOLD (AR_BASE + 5)
-#define AR_MENU (AR_BASE + 6)
-#define AR_MENU_HOLD (AR_BASE + 7)
-#define AR_VUP (AR_BASE + 8)
-#define AR_VDOWN (AR_BASE + 9)
-
-#ifndef AR_DEFINES_ONLY
-
+#define MP_AR_BASE (MP_KEY_BASE+0xE0)
+#define MP_AR_PLAY (MP_AR_BASE + 0)
+#define MP_AR_PLAY_HOLD (MP_AR_BASE + 1)
+#define MP_AR_NEXT (MP_AR_BASE + 2)
+#define MP_AR_NEXT_HOLD (MP_AR_BASE + 3)
+#define MP_AR_PREV (MP_AR_BASE + 4)
+#define MP_AR_PREV_HOLD (MP_AR_BASE + 5)
+#define MP_AR_MENU (MP_AR_BASE + 6)
+#define MP_AR_MENU_HOLD (MP_AR_BASE + 7)
+#define MP_AR_VUP (MP_AR_BASE + 8)
+#define MP_AR_VDOWN (MP_AR_BASE + 9)
/* Special keys */
-#define KEY_INTERN (MP_KEY_BASE+0x1000)
-#define KEY_CLOSE_WIN (KEY_INTERN+0)
+#define MP_KEY_INTERN (MP_KEY_BASE+0x1000)
+#define MP_KEY_CLOSE_WIN (MP_KEY_INTERN+0)
/* Modifiers added to individual keys */
-#define KEY_MODIFIER_SHIFT (1<<22)
-#define KEY_MODIFIER_CTRL (1<<23)
-#define KEY_MODIFIER_ALT (1<<24)
-#define KEY_MODIFIER_META (1<<25)
+#define MP_KEY_MODIFIER_SHIFT (1<<22)
+#define MP_KEY_MODIFIER_CTRL (1<<23)
+#define MP_KEY_MODIFIER_ALT (1<<24)
+#define MP_KEY_MODIFIER_META (1<<25)
-#endif // AR_DEFINES_ONLY
+#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)
#define MP_NO_REPEAT_KEY (1<<28)
-#define MP_KEY_DOWN (1<<29)
+#define MP_KEY_STATE_DOWN (1<<29)
#endif /* MPLAYER_KEYCODES_H */
diff --git a/core/mp_fifo.c b/core/mp_fifo.c
index f8410516d8..386eda5e80 100644
--- a/core/mp_fifo.c
+++ b/core/mp_fifo.c