Not “debugging” … the value comes before I even try to run the code. The background syntax checker highlights when the types don’t agree into and out of each function call and I don’t get errors like trying to index into an integer.
As for time… I guessed… I did not measure. I have limited time to play with this and don’t optimize unless I find myself waiting excessively for an answer.
I suggest that you should spend less effort looking for special hardware and more effort learning how keyboard mappings work in your OS (e.g. [1][2]). “Linux” is a very powerful chameleon because hardware vendors almost never cater directly to that market.
[1] https://linuxconfig.org/reprogram-keyboard-keys-with-xmodmap [2] https://github.com/xremap/xremap