I'm using a digispark arduino-compatible device to emulate a keyboard with an US layout (it uses DigiKeyboard.h
as library to do so).
Now,it just takes as input an integer which represent a key and sends it to the computer following the USB keyboard standards, everything fine until this point.
The problem is that I need this device to work with every keyboard layout, my question is: is there a way to "translate" the numeric value representing a character to the numeric value which represent the same character in any other layout using python? Obviously I cannot change the layout via software on the computer.
Example: lets say that in the US layout the character "x" is represented as the number 1. In the ES layout the character "x" is represented as the number 2. I need an hypothetic function that given the number 1 will output the number 2.
EDIT: Had some researches, couldn't find a proper solution, yet the hak5 team has developed something similar for the rubber ducky, you can find useful files on github