Adds support for keyboard button press and release as defined in linux/input-event-codes.h
Details
- Reviewers
davidedmundson apol romangg - Group Reviewers
Plasma - Commits
- R127:b12b919307d9: FakeInput: add support for keyboard key press and release
Diff Detail
- Repository
- R127 KWayland
- Branch
- master
- Lint
Lint Errors Excuse: Q_ENUM is a standard Qt macro Severity Location Code Message Error src/client/keystate.h:50 Cppcheck unknownMacro - Unit
No Unit Test Coverage - Build Status
Buildable 16229 Build 16247: arc lint + arc unit
src/client/fakeinput.h | ||
---|---|---|
222 | 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 [1]. |
src/client/fakeinput.h | ||
---|---|---|
222 | 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. |
+1
src/client/fakeinput.h | ||
---|---|---|
222 | 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. |
I'm not sure from the comment whether David requested some changes to be made now or whether this is good for now and we can improve this in future.