feat(patch): change remaps

removed backspace/backslash swap, remapped capslock to fn instead of ctrl

TODO: find and set fn key id/mapping
fn-hooks-wip-mine
steven 2021-09-29 11:30:07 -04:00
parent 52a92c70e5
commit 113b172e3d
1 changed files with 9 additions and 7 deletions

View File

@ -63,9 +63,10 @@ scancode_table2 = [0x00, 0x35, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
# See README for full id => key mapping # See README for full id => key mapping
key_id_ctrl = 17 key_id_ctrl = 17
key_id_caps = 20 key_id_fn = 0
key_id_backspace = 112 # key_id_caps = 20
key_id_backslash = 117 # key_id_backspace = 112
# key_id_backslash = 117
# Hex offsets to scancode tables in the raw original fw. These tables # Hex offsets to scancode tables in the raw original fw. These tables
# will be overwritten by our modified tables above # will be overwritten by our modified tables above
@ -111,12 +112,13 @@ def write_handle_fn_key_handler_hooks():
dest.write('b01302a8'.decode('hex')) dest.write('b01302a8'.decode('hex'))
if __name__ == '__main__': if __name__ == '__main__':
# Remap caps to ctrl # Remap caps to fn
scancode_table1[key_id_caps] = scancode_table1[key_id_ctrl] # 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 # Switch down backspace to \ and \ to backspace
scancode_table1[key_id_backspace], scancode_table1[key_id_backslash] = \ # scancode_table1[key_id_backspace], scancode_table1[key_id_backslash] = \
scancode_table1[key_id_backslash], scancode_table1[key_id_backspace] # scancode_table1[key_id_backslash], scancode_table1[key_id_backspace]
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Patch utility for Novatouch TKL firmware') description='Patch utility for Novatouch TKL firmware')