summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-29 08:46:50 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-29 08:46:50 +0300
commit85f0577cd9f520ccae29a0b85b4976df3b27db39 (patch)
tree5a9d697e81b07f233693901c8e8515332c29af4b
parentad48f8038cf3aa6392912ba65fede7cf71250001 (diff)
downloadmpv-85f0577cd9f520ccae29a0b85b4976df3b27db39.tar.bz2
mpv-85f0577cd9f520ccae29a0b85b4976df3b27db39.tar.xz
vo: X key input: remove ambiguous KeySym remapping
Code mapping X keyboard events to internal player key names remapped the incoming KeySym values in a way that only kept information about the lowest byte of the value and whether or not the value was below 256. This caused collisions between values. Remove this obviously broken mapping and use the raw KeySym values instead. I'm not familiar enough with X key handling to tell whether there was any valid motivation whatsoever for the mapping, but the implementation was certainly broken; if something else breaks it'll have to be fixed later.
-rw-r--r--libvo/wskeys.h124
-rw-r--r--libvo/x11_common.c7
2 files changed, 63 insertions, 68 deletions
diff --git a/libvo/wskeys.h b/libvo/wskeys.h
index 10d9b8b4e4..a236a9fd55 100644
--- a/libvo/wskeys.h
+++ b/libvo/wskeys.h
@@ -19,67 +19,67 @@
#ifndef MPLAYER_WSKEYS_H
#define MPLAYER_WSKEYS_H
-#define wsPause 0x13 + 256
-#define wsUp 0x52 + 256
-#define wsDown 0x54 + 256
-#define wsLeft 0x51 + 256
-#define wsRight 0x53 + 256
-#define wsLeftCtrl 0xe3 + 256
-#define wsRightCtrl 0xe4 + 256
-#define wsLeftAlt 0xe9 + 256
-#define wsRightAlt 0x7e + 256
-#define wsLeftShift 0xe1 + 256
-#define wsRightShift 0xe2 + 256
-#define wsEnter 0x0d + 256
-#define wsBackSpace 0x08 + 256
-#define wsCapsLock 0xe5 + 256
-#define wsTab 0x09 + 256
-#define wsF1 0xbe + 256
-#define wsF2 0xbf + 256
-#define wsF3 0xc0 + 256
-#define wsF4 0xc1 + 256
-#define wsF5 0xc2 + 256
-#define wsF6 0xc3 + 256
-#define wsF7 0xc4 + 256
-#define wsF8 0xc5 + 256
-#define wsF9 0xc6 + 256
-#define wsF10 0xc7 + 256
-#define wsF11 0xc8 + 256
-#define wsF12 0xc9 + 256
-#define wsInsert 0x63 + 256
-#define wsDelete 0xff + 256
-#define wsHome 0x50 + 256
-#define wsEnd 0x57 + 256
-#define wsPageUp 0x55 + 256
-#define wsPageDown 0x56 + 256
-#define wsNumLock 0x7f + 256
-#define wsEscape 0x1b + 256
-#define wsGrayEnter 0x8d + 256
-#define wsGrayPlus 0xab + 256
-#define wsGrayMinus 0xad + 256
-#define wsGrayMul 0xaa + 256
-#define wsGrayDiv 0xaf + 256
-#define wsGrayDecimal 0xae + 256
-#define wsGray0 0xb0 + 256
-#define wsGray1 0xb1 + 256
-#define wsGray2 0xb2 + 256
-#define wsGray3 0xb3 + 256
-#define wsGray4 0xb4 + 256
-#define wsGray5 0xb5 + 256
-#define wsGray6 0xb6 + 256
-#define wsGray7 0xb7 + 256
-#define wsGray8 0xb8 + 256
-#define wsGray9 0xb9 + 256
-#define wsGrayHome 0x95 + 256
-#define wsGrayLeft 0x96 + 256
-#define wsGrayUp 0x97 + 256
-#define wsGrayRight 0x98 + 256
-#define wsGrayDown 0x99 + 256
-#define wsGrayPgUp 0x9a + 256
-#define wsGrayPgDn 0x9b + 256
-#define wsGrayEnd 0x9c + 256
-#define wsGray5Dup 0x9d + 256
-#define wsGrayInsert 0x9e + 256
-#define wsGrayDelete 0x9f + 256
+#define wsPause 0xff13
+#define wsUp 0xff52
+#define wsDown 0xff54
+#define wsLeft 0xff51
+#define wsRight 0xff53
+#define wsLeftCtrl 0xffe3
+#define wsRightCtrl 0xffe4
+#define wsLeftAlt 0xffe9
+#define wsRightAlt 0xff7e
+#define wsLeftShift 0xffe1
+#define wsRightShift 0xffe2
+#define wsEnter 0xff0d
+#define wsBackSpace 0xff08
+#define wsCapsLock 0xffe5
+#define wsTab 0xff09
+#define wsF1 0xffbe
+#define wsF2 0xffbf
+#define wsF3 0xffc0
+#define wsF4 0xffc1
+#define wsF5 0xffc2
+#define wsF6 0xffc3
+#define wsF7 0xffc4
+#define wsF8 0xffc5
+#define wsF9 0xffc6
+#define wsF10 0xffc7
+#define wsF11 0xffc8
+#define wsF12 0xffc9
+#define wsInsert 0xff63
+#define wsDelete 0xffff
+#define wsHome 0xff50
+#define wsEnd 0xff57
+#define wsPageUp 0xff55
+#define wsPageDown 0xff56
+#define wsNumLock 0xff7f
+#define wsEscape 0xff1b
+#define wsGrayEnter 0xff8d
+#define wsGrayPlus 0xffab
+#define wsGrayMinus 0xffad
+#define wsGrayMul 0xffaa
+#define wsGrayDiv 0xffaf
+#define wsGrayDecimal 0xffae
+#define wsGray0 0xffb0
+#define wsGray1 0xffb1
+#define wsGray2 0xffb2
+#define wsGray3 0xffb3
+#define wsGray4 0xffb4
+#define wsGray5 0xffb5
+#define wsGray6 0xffb6
+#define wsGray7 0xffb7
+#define wsGray8 0xffb8
+#define wsGray9 0xffb9
+#define wsGrayHome 0xff95
+#define wsGrayLeft 0xff96
+#define wsGrayUp 0xff97
+#define wsGrayRight 0xff98
+#define wsGrayDown 0xff99
+#define wsGrayPgUp 0xff9a
+#define wsGrayPgDn 0xff9b
+#define wsGrayEnd 0xff9c
+#define wsGray5Dup 0xff9d
+#define wsGrayInsert 0xff9e
+#define wsGrayDelete 0xff9f
#endif /* MPLAYER_WSKEYS_H */
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 0ad2a30dd9..1b7636bba8 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -809,8 +809,6 @@ int vo_x11_check_events(struct vo *vo)
break;
case KeyPress:
{
- int key;
-
XLookupString(&Event.xkey, buf, sizeof(buf), &keySym,
&x11->compose_status);
int modifiers = 0;
@@ -825,10 +823,7 @@ int vo_x11_check_events(struct vo *vo)
#ifdef XF86XK_AudioPause
vo_x11_putkey_ext(vo, keySym, modifiers);
#endif
- key =
- ((keySym & 0xff00) !=
- 0 ? ((keySym & 0x00ff) + 256) : (keySym));
- vo_x11_putkey(vo, key, modifiers);
+ vo_x11_putkey(vo, keySym, modifiers);
ret |= VO_EVENT_KEYPRESS;
}
break;