Commit Graph

17 Commits (1786e0d5490aeaa96cef1447e10a3595c512d4bb)

Author SHA1 Message Date
Andri Yngvason ff882b7774 keyboard: Ignore shift level on modifiers 2020-05-26 22:19:48 +00:00
Andri Yngvason ff1223e4f9 keyboard: Fix comparison of signed and unsigned value 2020-05-18 20:38:48 +00:00
Andri Yngvason f5453ffe1e keyboard: Relax matching criteria on shift level
Clients behave differently when it comes to sending release events for keys,
so it's hard to rely on any one kind of behaviour.
2020-05-01 17:34:22 +00:00
Andri Yngvason 405268fc58 keyboard: Log keyboard symbol lookup errors 2020-05-01 17:19:14 +00:00
Greg V 3f62295214 keyboard: rename keymap_len to keymap_size 2020-04-09 15:39:09 +03:00
Greg V fa49aca45a keyboard: check that write finished writing everything
(Use loop to write until the end)
2020-04-09 15:38:13 +03:00
Greg V ccc582cd58 keyboard: allocate shm with *actually* correct size
strlen returns "the number of characters that precede the terminating NUL".
We do need to send the \0 byte, since xkbcommon on the receiving end
*is* expecting a C string. And e.g. wlroots does strlen+1.
2020-04-09 15:37:18 +03:00
Greg V 720b127dee keyboard: allocate shm with correct size
This was working on Linux because shm_open there returns a regular file,
but this is required on FreeBSD where shm_open returns a memory-backed fd.
2020-04-06 00:26:22 +03:00
Andri Yngvason e6b1ca8044 keyboard: Assign state to keys rather than symbols
The keys are pressed and released, not the symbols. This fixes tracking
of the state of a key through modifier changes. E.g. A capital 'A' may
be received from the client while the shift key is pressed, but if the
shift key is released before the 'a' key, the 'a' symbol is generated.
2020-01-25 13:19:08 +00:00
Andri Yngvason 48907682c7 keyboard: Fix modifier lookup 2020-01-20 21:15:04 +00:00
Andri Yngvason 5731ea4666 keyboard: Add bounds checking on keycode lookup 2020-01-19 12:43:48 +00:00
Andri Yngvason e2079a7e56 keyboard: Don't send repeated events to server
This caused the virtual key to get "stuck" in the pressed position and
then to stop working at all. It's definitely a bug on the server side
also.
2020-01-15 20:34:56 +00:00
Andri Yngvason 476854aeaf keyboard: Remove debug printout 2020-01-03 20:42:40 +00:00
Andri Yngvason 990e57fa89 keyboard: Improve key code lookup
The shift level for each symbol is now included in the lookup table, so
it's more robust for various keyboard layouts.
2020-01-03 20:03:02 +00:00
Andri Yngvason 2b00400b8a Add option to select keyboard layout 2019-12-30 10:15:12 +00:00
Andri Yngvason 5c7f941481 keyboard: Add some acknowledgements 2019-12-25 11:45:07 +00:00
Andri Yngvason b2bbc9ac0b Implement keyboard backend 2019-12-25 11:05:05 +00:00