kernc / logkeys

:memo: :keyboard: A GNU/Linux keylogger that works!
Other
748 stars 251 forks source link

Half automatic keymap generation [enhancement] [feature-request] #218

Open mFIND opened 4 years ago

mFIND commented 4 years ago

Creating new keymappings is sometimes a slow and painful process. If would be nice if the program allowed for simplifying this process. This could be done interactively, for example:

  1. User run program in "help me create keymappings" mode
  2. Programs opens specific /dev input device, let's now just assume that's this is the correct one - keyboard.
  3. Program asks to press some specific keys one after another (with Shift and AltGr if applicable), at the same time registering /dev input. This could be done with messages:
    • now press F1
    • ...
    • now press LShift+1
    • ...
    • now press a key on the right of your LShift
  4. After enough input gets collected to determine the right keyboard (maybe there are some databases online that can help with limiting number of checks required?), correct keymappings could be generated.
kernc commented 4 years ago

I think our keymap format mostly follows the order of dumpkeys. Surely that output can be tweaked and transformed into something that is easier to review, yet still mostly automatic? There's a folder with known keymaps: https://github.com/kernc/logkeys/tree/master/keymaps The correct one shouldn't be too hard to find?

mFIND commented 4 years ago

That should be true, however for some reason default keymap for my keyboard was different, letters were shifted etc. However keymap for my country (PL) in the folder you mentioned differed from my final keymap, so... here is mine: https://pastebin.com/uRDDhmzX $> locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC=pl_PL.UTF-8 LC_TIME=pl_PL.UTF-8 LC_COLLATE="en_US.UTF-8" LC_MONETARY=pl_PL.UTF-8 LC_MESSAGES="en_US.UTF-8" LC_PAPER=pl_PL.UTF-8 LC_NAME=pl_PL.UTF-8 LC_ADDRESS=pl_PL.UTF-8 LC_TELEPHONE=pl_PL.UTF-8 LC_MEASUREMENT=pl_PL.UTF-8 LC_IDENTIFICATION=pl_PL.UTF-8 LC_ALL= $> locale -a C C.UTF-8 en_AG en_AG.utf8 en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8 en_IL en_IL.utf8 en_IN en_IN.utf8 en_NG en_NG.utf8 en_NZ.utf8 en_PH.utf8 en_SG.utf8 en_US.utf8 en_ZA.utf8 en_ZM en_ZM.utf8 en_ZW.utf8 pl_PL.utf8 POSIX