From 3d07c994456ed7c4ac436b084bb747fd3e6b43c5 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Wed, 25 Jan 2017 16:22:28 +0800 Subject: [PATCH] Add asm definition for complex replacement table --- asm/ec.asm | 12 ++++++---- asm/ec_fn_action_x230.mac | 15 ++++++++++++ asm/ec_key_combo1_x220.mac | 3 ++- asm/ec_key_combo1_x230.mac | 3 ++- asm/ec_key_combo2_x230.mac | 37 ++++++++++++++++++++++++++++++ asm/ec_key_combo2_x230_patched.mac | 37 ++++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 6 deletions(-) create mode 100644 asm/ec_fn_action_x230.mac create mode 100644 asm/ec_key_combo2_x230.mac create mode 100644 asm/ec_key_combo2_x230_patched.mac diff --git a/asm/ec.asm b/asm/ec.asm index c1da175..112d666 100644 --- a/asm/ec.asm +++ b/asm/ec.asm @@ -1,8 +1,6 @@ %define orig_bin "x230.G2HT35WW.img" -%include "ec_keysym.mac" - ; include orig_bin from $ for size $1 %macro ib 1 incbin orig_bin,$,%1 @@ -283,8 +281,11 @@ table.000215c4: jump_table.0x0002164c: ib 0x0002166c - 0x0002164c table_fn_key_complex: - ; FIXME - add in the definitions - ib 0x000216a4 - 0x0002166c + %include "ec_key_combo2_x230_patched.mac" + + ; padding + align 4, db 0 + table_ptr_fn_key_complex_stuff: dd 8 ; jump table size dd jump_table.0x0002164c @@ -302,6 +303,9 @@ table_numpad2: table_keysym_replacements: %include "ec_key_combo1_x220.mac" + ; padding + align 4, db 0 + table_ptr_numpad_stuff: dd 0xb2 ; size of next table dd table.000216b4 diff --git a/asm/ec_fn_action_x230.mac b/asm/ec_fn_action_x230.mac new file mode 100644 index 0000000..523fa03 --- /dev/null +++ b/asm/ec_fn_action_x230.mac @@ -0,0 +1,15 @@ +; +; This is a list of definitions +; + +%ifndef EC_FN_ACTION +%define EC_FN_ACTION + +%define ACT_0 0xc0 ; I am assuming this is refering to another table +%define ACT_THINKLIGHT 0xc6 +%define ACT_SLEEP 0xc7 + +%define ACT_BRIGHT_UP 0xe4 +%define ACT_BRIGHT_DN 0xe5 + +%endif diff --git a/asm/ec_key_combo1_x220.mac b/asm/ec_key_combo1_x220.mac index 767b901..b86ab26 100644 --- a/asm/ec_key_combo1_x220.mac +++ b/asm/ec_key_combo1_x220.mac @@ -4,6 +4,8 @@ ; Values are for the original x220 keyboard +%include "ec_keysym.mac" + ; Fn+THIS replaced with shift state? db KEY_PRINT, KEY_SYSRQ, 1 db KEY_SCROLLLOCK, KEY_NUMLOCK, 0 @@ -16,4 +18,3 @@ db 0x9e,0x9e,0 ; FIXME db 0x9f,0x9f,0 ; FIXME db 0x4a,0x4a,0 ; FIXME - db 0,0,0 diff --git a/asm/ec_key_combo1_x230.mac b/asm/ec_key_combo1_x230.mac index 97168fa..0492c8f 100644 --- a/asm/ec_key_combo1_x230.mac +++ b/asm/ec_key_combo1_x230.mac @@ -4,6 +4,8 @@ ; Values are for the original x230 keyboard +%include "ec_keysym.mac" + ; Fn+THIS replaced with shift state? db KEY_F10, KEY_PREVIOUSSONG, 0 db KEY_F11, KEY_PLAYPAUSE, 0 @@ -16,5 +18,4 @@ db 0x9e,0x9e,0 ; FIXME db 0x9f,0x9f,0 ; FIXME db 0x4a,0x4a,0 ; FIXME - db 0,0,0 diff --git a/asm/ec_key_combo2_x230.mac b/asm/ec_key_combo2_x230.mac new file mode 100644 index 0000000..77f6803 --- /dev/null +++ b/asm/ec_key_combo2_x230.mac @@ -0,0 +1,37 @@ +; +; This is the "complex" Fn+key replacement table +; + +; Values are for the original x230 keyboard + +%include "ec_keysym.mac" +%include "ec_fn_action_x230.mac" + + ; action keysym + db ACT_0, KEY_F1 ; nothing + db ACT_0, KEY_F2 ; nothing + db ACT_0, KEY_F3 ; Lock + db ACT_SLEEP, KEY_F4 ; Sleep + db ACT_BRIGHT_UP, KEY_F9 + db ACT_BRIGHT_DN, KEY_F8 + db ACT_0, KEY_F7 + db ACT_0, 0 + db ACT_0, 0 + db ACT_0, KEY_PROG1 ; Thinkvantage button + db ACT_0, 0 + db 0xc8, 0 ; FIXME + db ACT_0, KEY_1 + db ACT_0, KEY_2 + db 0,0 + db ACT_THINKLIGHT, KEY_SPACE + db 0,0 + db 0,0 + db 0,0 + db ACT_0, 0 + db ACT_0, KEY_F5 ; Wifi Switch + db ACT_0, KEY_F6 ; Camera Switch + db 0,0 + db 0,0 + db 0,0 + db 0,0 + db ACT_0, KEY_MICMUTE diff --git a/asm/ec_key_combo2_x230_patched.mac b/asm/ec_key_combo2_x230_patched.mac new file mode 100644 index 0000000..12a6c52 --- /dev/null +++ b/asm/ec_key_combo2_x230_patched.mac @@ -0,0 +1,37 @@ +; +; This is the "complex" Fn+key replacement table +; + +; Values are for the x220 keyboard installed in a x230 motherboard + +%include "ec_keysym.mac" +%include "ec_fn_action_x230.mac" + + ; action keysym + db ACT_0, KEY_F1 ; nothing + db ACT_0, KEY_F3 ; Lock + db ACT_0, KEY_F2 ; nothing + db ACT_SLEEP, KEY_F4 ; Sleep + db ACT_BRIGHT_UP, KEY_HOME + db ACT_BRIGHT_DN, KEY_END + db ACT_0, KEY_F7 + db ACT_0, KEY_F8 + db ACT_0, KEY_F9 + db ACT_0, KEY_PROG1 ; Thinkvantage button + db ACT_0, KEY_F11 + db 0xc8, 0 ; FIXME + db ACT_0, KEY_1 + db ACT_0, KEY_2 + db 0,0 + db ACT_THINKLIGHT, KEY_PAGEUP + db 0,0 + db 0,0 + db 0,0 + db ACT_0, KEY_SPACE + db ACT_0, KEY_F5 ; Wifi Switch + db ACT_0, KEY_F6 ; Camera Switch + db 0,0 + db 0,0 + db 0,0 + db 0,0 + db ACT_0, KEY_MICMUTE