Adds support for keyboard button press and release as defined in linux/input-event-codes.h
I will need a little bit of help to understand what type of key event should be used and I don't remember where I got the information it expects codes defined from linux/input-event-codes.h (I copied it from the previous review)
Anyway, for the remote desktop portal, we will need to support both keysym and keycodes .
Ok, I think I understand now.
KWin uses KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time, LibInput::Device *device), where Xkb::updateKey(uint32_t key, InputRedirection::KeyboardKeyState state) is called. The second method expects a key code as defined in linux/input-event-codes.h and passing key + 8 to xkb_state_update_key() call.
So I think we want to keep it this way and accept key codes as defined in linux/input-event-codes.h so we can directly bind this in KWin to a key press event.
We had a big discussion on this last kwin sprint.
There's value in keycodes, values in keysyms depending on the use case. Especially if the remote sender has a different keymap.. Potentially some things don't even map.
The protocol could do with a line that the code is related to the keymap set on the client's seat. (currently kwin only really supports one)
The "most technically correct" if for fake input to send a keymap, then us to forward that keymap to clients, then pass that keycode on the relevant fake keyboard.
IMHO we can do this for now and iterate a year from now.