[MPlayer-dev-eng] [PATCH] add alias for CTRL + key bindings

Gianluigi Tiesi mplayer at netfarm.it
Thu May 8 03:25:50 CEST 2008


Hi,
I've got an infrared hid device with a remote control
many keys are mapped to ctrl + something,
I'm aways there is 0xyy key mapping
but adding these aliases can be more comfortable


Regards

-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -NpuBr -Xexclude.txt main/input/input.c sherpya/input/input.c
--- main/input/input.c	2008-04-30 08:17:37.656250000 +0200
+++ sherpya/input/input.c	2008-05-08 03:11:33.000000000 +0200
@@ -198,6 +198,33 @@ static const mp_cmd_t mp_cmds[] = {
 /// If you add some new keys, you also need to add them here
 
 static const mp_key_name_t key_names[] = {
+
+  { CTRL_A,     "CTRL_A" },
+  { CTRL_B,     "CTRL_B" },
+  { CTRL_C,     "CTRL_C" },
+  { CTRL_D,     "CTRL_D" },
+  { CTRL_E,     "CTRL_E" },
+  { CTRL_F,     "CTRL_F" },
+  { CTRL_G,     "CTRL_G" },
+  { CTRL_J,     "CTRL_J" },
+  { CTRL_K,     "CTRL_K" },
+  { CTRL_N,     "CTRL_N" },
+  { CTRL_O,     "CTRL_O" },
+  { CTRL_P,     "CTRL_P" },
+  { CTRL_Q,     "CTRL_Q" },
+  { CTRL_L,     "CTRL_L" },
+  { CTRL_V,     "CTRL_V" },
+  { CTRL_W,     "CTRL_W" },
+  { CTRL_R,     "CTRL_R" },
+  { CTRL_S,     "CTRL_S" },
+  { CTRL_Z,     "CTRL_Z" },
+  { CTRL_SO,    "CTRL_[" },
+  { CTRL_BSL,   "CTRL_\\"},
+  { CTRL_SC,    "CTRL_]" },
+  { CTRL_T,     "CTRL_T" },
+  { CTRL_U,     "CTRL_U" },
+  { CTRL_Y,     "CTRL_Y" },
+
   { ' ', "SPACE" },
   { '#', "SHARP" },
   { KEY_ENTER, "ENTER" },
diff -NpuBr -Xexclude.txt main/osdep/keycodes.h sherpya/osdep/keycodes.h
--- main/osdep/keycodes.h	2008-04-30 08:18:13.546875000 +0200
+++ sherpya/osdep/keycodes.h	2008-05-08 03:08:34.390625000 +0200
@@ -74,4 +74,34 @@
 #define KEY_INTERN (0x1000)
 #define KEY_CLOSE_WIN (KEY_INTERN+0)
 
+/* Ctrl + Key */
+#define CTRL_A      (0x01)
+#define CTRL_B      (0x02)
+#define CTRL_C      (0x03)
+#define CTRL_D      (0x04)
+#define CTRL_E      (0x05)
+#define CTRL_F      (0x06)
+#define CTRL_G      (0x07)
+/* #define CTRL_H      (0x08) */ /* KEY_BACKSPACE */
+/* #define CTRL_I      (0x09) */ /* KEY_TAB */
+#define CTRL_J      (0x0a)
+#define CTRL_K      (0x0b)
+/* #define CTRL_M      (0x0c) */ /* KEY_ENTER */
+#define CTRL_N      (0x0e)
+#define CTRL_O      (0x0f)
+#define CTRL_P      (0x10)
+#define CTRL_Q      (0x11)
+#define CTRL_L      (0x12)
+#define CTRL_V      (0x16)
+#define CTRL_W      (0x17)
+#define CTRL_R      (0x18)
+#define CTRL_S      (0x19)
+#define CTRL_Z      (0x1a)
+#define CTRL_SO     (0x1b)
+#define CTRL_BSL    (0x1c)
+#define CTRL_SC     (0x1d)
+#define CTRL_T      (0x20)
+#define CTRL_U      (0x21)
+#define CTRL_Y      (0x25)
+
 #endif /* MPLAYER_KEYCODES_H */


More information about the MPlayer-dev-eng mailing list