Commit Graph

33 Commits

Author SHA1 Message Date
Simon Ser 62924cc523 keyboard: add wlr_keyboard.keymap_fd
This exposes a read-only FD with the keymap.
2021-09-05 22:06:25 +02:00
Isaac Freund 7693f61d81 Replace wlr_key_state with wl_keyboard_key_state
There's no reason to have duplicate enums
2020-11-11 10:58:38 +01:00
Tudor Brindus 7c6e06fd13 types/wlr_keyboard: use bitmasks for wlr_keyboard_led and wlr_keyboard_modifier enums 2020-10-31 23:15:21 +01:00
Tudor Brindus 064f64dbf7 input/keyboard: expose keymap matching helper
sway needs this logic too, and currently ships a version that has fallen
behind in terms of bugfixes (b1a63bc).
2020-05-07 23:10:03 -04:00
Isaac Freund 8707a9b7ec Return false on wlr_keyboard_set_keymap() failure
This allows users of the library to handle or ignore the error as they
see fit.
2020-03-24 00:22:50 +01:00
Brian Ashworth f2d3b1000f Introduce wlr_keyboard_group
A wlr_keyboard_group allows for multiple keyboard devices to be
combined into one logical keyboard. Each keyboard device can only be
added to one keyboard group. This helps with the situation where one
physical keyboard is exposed as multiple keyboard devices. It is up to
the compositors on how they group keyboards together, if at all.

Since a wlr_keyboard_group is one logical keyboard, the keys are a set.
This means that if a key is pressed on multiple keyboard devices, the
key event will only be emitted once, but the internal state will count
the number of devices that the key is pressed on. Likewise, the key
release will not be emitted until the key is released from all devices.
If the compositor wants access to which keys are pressed and released
on each keyboard device, the events for those devices can be listened
to, as they currently are, in addition to the group keyboard's events.

Also, all keyboard devices in the group must share the same keymap. If
the keymap's differ, the keyboard device will not be able to be added
to the group. Once in the group, if the keymap or effective layout for
one keyboard device changes, it will be synced to all keyboard devices
in the group. The repeat info and keyboard modifiers are also synced
2019-11-05 20:05:49 +01:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
random human 40a43003a1
Send unique keymap file descriptors
To prevent wl_keyboard keymap being written to by clients, use a unique
file descriptor for each wl_keyboard resource.

Reference: weston, commit 76829fc4eaea329d2a525c3978271e13bd76c078
2018-09-18 13:58:36 +05:30
Drew DeVault 211ae764fd Initial pass on API stability guarantees
This introduces -DWLR_USE_UNSTABLE and adds information regarding the
stability status to all headers. I started with a conservative set of
headers to mark as stable:

- types/wlr_matrix.h
- util/edges.h
- util/log.h
- util/region.h
- xcursor.h
2018-07-29 19:20:34 -04:00
emersion 551700e887
backend/wayland: fix keyboard keys not pressed/released when focus changes 2018-06-03 13:18:57 +01:00
Tony Crisci 9971d06afb document key and modifier signals 2018-05-26 11:32:45 -04:00
emersion f8e0a03451
backend/x11: correctly destroy input devices 2018-04-28 12:55:36 +01:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
Tony Crisci b6f29e87e8 dont use pointer for modifiers 2018-01-17 08:31:15 -05:00
Tony Crisci 0ef2df21f2 compositor modifier hook 2018-01-05 07:00:50 -05:00
Tony Crisci e8b810ce3e keep track of number of keycodes pressed 2017-12-27 18:58:43 -05:00
emersion 2c6e52c164
Add docs for wlr_keyboard_set_repeat_info 2017-12-08 17:06:31 +01:00
emersion a3c0f97810
Make keyboard repeat info configurable 2017-12-08 17:03:05 +01:00
emersion 84d5e6bbb4
Send current keyboard state when entering a surface 2017-11-08 10:57:46 +01:00
Tony Crisci 875a5b446f remove time usec 2017-10-30 15:43:06 -04:00
Tony Crisci a224e74fad refactor input time_sec to time_msec 2017-10-30 06:40:06 -04:00
Timidger 3abf713e35 Fixed include in wlr_keyboard.h 2017-10-08 18:55:59 -07:00
Versus Void 568b270cdf Use xkb_state_update_mask() with Wayland backend
Fix #158
2017-10-06 22:02:29 +00:00
emersion 521e893528
Add modifiers signal, remove wlr_keyboard_update_modifiers 2017-10-03 14:03:26 +02:00
emersion 3a8fdebaaa
Fix modifiers handling, add wlr_keyboard_get_modifiers 2017-10-03 08:46:11 +02:00
emersion 2fccff16eb
Begin modifiers support 2017-10-03 08:46:11 +02:00
Drew DeVault f4387b437f Merge branch 'master' into rootston 2017-09-25 08:29:51 -04:00
Drew DeVault 61e451ea1b Move keyboard logic to wlr_{keyboard,seat} 2017-09-24 14:12:56 -04:00
emersion 427bdb5b55
Use more consistent include guard names 2017-09-23 10:26:01 +02:00
Dominique Martinet 0a3246ad97 Refactor out wlr_keyboard_state 2017-08-14 16:22:31 +02:00
Calvin Lee a8c1e8ce69 Add user data to wlr_* structs
Resolves #68
2017-08-11 20:44:17 +02:00
Drew DeVault 3d71969b2a Make event names consistent 2017-06-21 14:07:09 -04:00
Drew DeVault 53a8b4f127 Split out types.h and wlr/types.h
TODO: Update the code accordingly and move other types into the same
paradigm
2017-06-21 10:10:04 -04:00