From 113b172e3da3239c07eb701fded15501ed0572bc Mon Sep 17 00:00:00 2001 From: steven-y-e Date: Wed, 29 Sep 2021 11:30:07 -0400 Subject: [PATCH] feat(patch): change remaps removed backspace/backslash swap, remapped capslock to fn instead of ctrl TODO: find and set fn key id/mapping --- patch.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/patch.py b/patch.py index 8438599..33ec3fc 100644 --- a/patch.py +++ b/patch.py @@ -63,9 +63,10 @@ scancode_table2 = [0x00, 0x35, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, # See README for full id => key mapping key_id_ctrl = 17 -key_id_caps = 20 -key_id_backspace = 112 -key_id_backslash = 117 +key_id_fn = 0 +# key_id_caps = 20 +# key_id_backspace = 112 +# key_id_backslash = 117 # Hex offsets to scancode tables in the raw original fw. These tables # will be overwritten by our modified tables above @@ -111,12 +112,13 @@ def write_handle_fn_key_handler_hooks(): dest.write('b01302a8'.decode('hex')) if __name__ == '__main__': - # Remap caps to ctrl - scancode_table1[key_id_caps] = scancode_table1[key_id_ctrl] + # Remap caps to fn + # scancode_table1[key_id_caps] = scancode_table1[key_id_ctrl] + scancode_table1[key_id_caps] = scancode_table1[key_id_fn] # Switch down backspace to \ and \ to backspace - scancode_table1[key_id_backspace], scancode_table1[key_id_backslash] = \ - scancode_table1[key_id_backslash], scancode_table1[key_id_backspace] + # scancode_table1[key_id_backspace], scancode_table1[key_id_backslash] = \ + # scancode_table1[key_id_backslash], scancode_table1[key_id_backspace] parser = argparse.ArgumentParser( description='Patch utility for Novatouch TKL firmware')