Skip to content

Separate keycodes and scancodes. Update KeyEvent.

Jeremy Soller requested to merge Ploppz:key_event_change into master

Created by: Ploppz

There are upcoming PRs in drivers and 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 K_*, to 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.

keymap module

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.

Edited by Ribbon

Merge request reports