3 ms·
This is something I never thought about. So key codes are based on the physical location of the key on a standard layout/qwerty, and changing your layout will c
by jtokoph 3y ago
This is something I never thought about. So key codes are based on the physical location of the key on a standard layout/qwerty, and changing your layout will cause the key value to change but not the code?
- an_ko 3y agoYes, approximately. In X11 at least, the hardware codes are called keycodes, and the human readable names are called keysyms. Example of the XkbKeycodeToKeysym function in use: https://github.com/anko/xkbcat/blob/8abc3402cb679027a3bd03135a44c4884e5eccf6/xkbcat.c#L126 https://github.com/anko/xkbcat/blob/8abc3402cb679027a3bd0313... Keysyms don't necessarily strictly match "key location"; keyboards are allowed to output whatever codes they want for whatever key they want (see e.g. QMK firmware; often used in custom keyboards to do complex conditional key remapping), but they're in practice relatively consistent between common keys on most keyboards, and consistent on the same keyboard even if you switch keyboard layouts in software, unless you have some custom keyboard firmware which functionality is stateful.
- deleted 3y ago[deleted]