Keyboard: fix key handling/eating logic

As noticed by leon-p, last refactorings made river send a release event
to the client even if the press event has been eaten. In addition, the
introduction of input method support means that we need to remember
*why* we've eaten the key.

Also make KeycodeSet more strict: i am not aware of any case when a
keyboard could have the same key pressed twice (specifically, keyboard
groups have this handled in wlroots), so make the behavior follow a
smaller set of possible scenarios.
This commit is contained in:
tiosgz
2024-01-27 11:43:40 +00:00
parent 69a51cadb4
commit 66f1881a72
3 changed files with 56 additions and 33 deletions

View File

@ -307,6 +307,7 @@ fn keyboardNotifyEnter(self: *Self, wlr_surface: *wlr.Surface) void {
if (self.wlr_seat.getKeyboard()) |wlr_keyboard| {
var keycodes = KeycodeSet{
.items = wlr_keyboard.keycodes,
.reason = .{.none} ** 32,
.len = wlr_keyboard.num_keycodes,
};