Commit Graph

27 Commits (17841f9ece526aaebceb753fcfa4408eb34b9e70)

Author SHA1 Message Date
Andri Yngvason 9e85093a6d keyboard: Prefer lower keycodes
Xwayland can't handle keycodes above 255, so in order to play nice with X11,
we try to use the lowest possible keycode that's applicable for the given
shift level.

Fixes #148
2022-09-14 21:34:22 +00:00
Andri Yngvason 7c75c8919c Use neatvnc logging facilities 2022-06-25 16:14:18 +00:00
Andri Yngvason e3af211523 keyboard: Show warning when multiple layouts are specified 2020-12-27 19:34:06 +00:00
Andri Yngvason 0178c13627 keyboard: Always use layout index 0
Layout switching isn't supported anyhow. Better not to confuse things.
2020-12-27 19:26:54 +00:00
Andri Yngvason d0aa51aa6e keyboard: Pass struct xkb_rule_names to keyboard_init 2020-12-26 21:07:49 +00:00
Andri Yngvason 482ebaf168 keyboard: Match shift levels to keycodes when needed 2020-12-26 17:19:34 +00:00
Andri Yngvason 2957f6f3a2 keyboard: Split keyboard_feed_code() into more functions 2020-12-26 17:19:34 +00:00
Andri Yngvason d978d94041 keyboard: Extract function 'keyboard_feed_code()' 2020-11-29 18:58:21 +00:00
Flakebi 98d703bfa8 Fix de-neo layout
- Add possibility to specify layout variant with -k <layout>-<variant>
- Add ISO_Level5_Shift and ISO_Level5_Lock to modifier keys
2020-10-17 18:06:12 +00:00
Andri Yngvason ef6756d0f4 keyboard: suppress unused variable warnings in release build 2020-07-26 13:47:20 +00:00
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