summaryrefslogtreecommitdiffstats
path: root/mp_fifo.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-25 09:43:59 +0300
committerUoti Urpala <uau@mplayer2.org>2011-05-02 00:43:31 +0300
commit23cb82907220d0c2724a0ec92bde437cbcd67d6a (patch)
tree1c1ea8667a2da5b6ddb5dd8e2f0c6f6558304ab5 /mp_fifo.c
parent3e86228fad309b54869bf2a3314756933ba74e43 (diff)
downloadmpv-23cb82907220d0c2724a0ec92bde437cbcd67d6a.tar.bz2
mpv-23cb82907220d0c2724a0ec92bde437cbcd67d6a.tar.xz
input: move all key code lists to input/keycodes.h
Move the definitions of all special key codes (those not passed by ASCII value) to input/keycodes.h. Before they were spread between osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus some special values in input.h. This was especially inconvenient as the codes had to be coordinated to not conflict between the files. The change requires a bit of ugliness as appleir.c includes <linux/input.h> which contains various conflicting KEY_* definitions. Work around this by adding a special preprocessor variable which can be used to avoid defining these in keycodes.h.
Diffstat (limited to 'mp_fifo.c')
-rw-r--r--mp_fifo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mp_fifo.c b/mp_fifo.c
index 4c8e9c6496..97a3b06ce0 100644
--- a/mp_fifo.c
+++ b/mp_fifo.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include "osdep/timer.h"
#include "input/input.h"
-#include "input/mouse.h"
+#include "input/keycodes.h"
#include "mp_fifo.h"
#include "talloc.h"
#include "options.h"
@@ -70,7 +70,7 @@ int mplayer_get_key(void *ctx, int fd)
static void put_double(struct mp_fifo *fifo, int code)
{
- if (code >= MOUSE_BTN0 && code <= MOUSE_BTN9)
+ if (code >= MOUSE_BTN0 && code < MOUSE_BTN_END)
mplayer_put_key_internal(fifo, code - MOUSE_BTN0 + MOUSE_BTN0_DBL);
}
@@ -81,7 +81,7 @@ void mplayer_put_key(struct mp_fifo *fifo, int code)
// ignore system-doubleclick if we generate these events ourselves
if (doubleclick_time
&& (code & ~MP_KEY_DOWN) >= MOUSE_BTN0_DBL
- && (code & ~MP_KEY_DOWN) <= MOUSE_BTN9_DBL)
+ && (code & ~MP_KEY_DOWN) < MOUSE_BTN_DBL_END)
return;
mplayer_put_key_internal(fifo, code);
if (code & MP_KEY_DOWN) {