Separate keycodes and scancodes. Update KeyEvent.
Created by: Ploppz
There are upcoming PRs in
orbtk to adapt to these changes.
Separation between keycodes and scancodes.
At the moment, it's roughly a one-to-one mapping between the two. I aimed to just make it work, and not carry out a thorough definition of all keycodes that could be needed. Now the structure is there.
It went from
keycode::KC_* for keycodes and
scancode::SC_* for scancodes.
Changes to KeyEvent
- KeyEvent takes a keycode rather than a scancode.
- KeyEvent holds a byte with modifier keys. This is not strictly necessary but very convenient.
struct Keymap is only used in
drivers/vesad, and should probably be moved there. However, I also think we should consider moving certain other things (perhaps everything in the new "input" module) such as event structs (seeing as
ps2d depends on
orbclient solely to agree upon these). But I saw it as an okay solution to keep these things in
orbclient for now, since
ps2d already depends on it.
Keymaps follow a very simple format (never mind the comment in the code mentioning CSV, it's irrelevant and I will remove it). Each line is for a keycode corresponding to that line number. Entries are divided in columns with hard tabs. Each entry can be a single character, or a hexadecimal number with a preceding backslash. This ought to change to a more user-friendly format.