summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2011-06-30 14:19:01 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-01-26 14:40:26 +0000
commit3d3114d55a2a323f8d49c3549a0dfdf9d4acf89d (patch)
treecaf912a8a248c1a6dc8da2accc22b11d2943f32a
parent74af860f9a59332f6ed1ac9b3e7867fbbb3d7305 (diff)
hw/xwin: Handle the virtual key code generated by the Fn key on IBM Lenovo laptops
Apparently, IBM Leonovo laptops can generate a key-press event for the Fn key, with virtual key code 0xFF and scan code extended 0x63 Handle this specially, rather than just passing on key code 0x63 (delete), so you don't delete what you just typed when you adjust the screen brightness, etc. :-) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r--hw/xwin/winkeybd.h4
-rw-r--r--hw/xwin/winkeynames.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index 4e4c35c37..5135e9ced 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -35,6 +35,8 @@
*/
#include "winkeynames.h"
+#define VK_FN 0xFF
+
#define WIN_KEYMAP_COLS 3
/* Rows 160 through 165 correspond to software-generated codes, which
@@ -298,7 +300,7 @@ g_iKeyMap [] = {
/* 252 */ 0, 0, 0,
/* 253 */ 0, 0, 0,
/* 254 */ 0, 0, 0,
- /* 255 */ 0, 0, 0
+ /* 255 */ VK_FN, 0, KEY_Fn /* Most keyboards don't generate a scancode for Fn, but a few do... */
};
#endif /* WINKEYBD_H */
diff --git a/hw/xwin/winkeynames.h b/hw/xwin/winkeynames.h
index 914016a76..75e172e1f 100644
--- a/hw/xwin/winkeynames.h
+++ b/hw/xwin/winkeynames.h
@@ -144,7 +144,7 @@
#define KEY_KP_0 /* 0 Insert 0x52 */ 82
#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
#define KEY_SysReqest /* SysReqest 0x54 */ 84
- /* NOTUSED 0x55 */
+#define KEY_Fn /* Fn 0x55 */ 85
#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
#define KEY_F11 /* F11 0x57 */ 87
#define KEY_F12 /* F12 0x58 */ 88