mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-09 01:00:11 +02:00
Merge PR #41 from SuperTuxii/allow-more-keys: input: Allow sending keys >= BTN_MISC and allow sending keys from nodes with volume role
This commit is contained in:
commit
82979e4423
2 files changed
+9
-7
No files matched your search
@@ -1050,7 +1050,7 @@ def main():
|
||||
|
||||
def to_screens(code, value):
|
||||
"""A key for the desktop screens (ft-screens decides whether it types)."""
|
||||
if value in (0, 1) and code < BTN_MISC:
|
||||
if value in (0, 1):
|
||||
try:
|
||||
screens_sock.sendto(f"key {code} {value}".encode(), SCREENS)
|
||||
except OSError:
|
||||
@@ -1400,9 +1400,7 @@ def main():
|
||||
or (node.grabbed and code in VOLUME_STANDIN)):
|
||||
volume.key(fd, code, value, now)
|
||||
continue
|
||||
if node.role == "volume":
|
||||
continue
|
||||
if node.role != "pointer":
|
||||
if node.role != "pointer" and node.role != "volume":
|
||||
# Observed only, unless typing goes to the desktop. Key combinations work on
|
||||
# any pass-through keyboard.
|
||||
if (node.role == "passthrough" and etype == EV_KEY and node.grabbed
|
||||
|
||||
@@ -548,9 +548,13 @@ static void send_key(struct server *s, uint32_t code, int pressed) {
|
||||
struct wlr_keyboard_key_event ev = {
|
||||
.time_msec = now_ms(), .keycode = code, .update_state = true,
|
||||
.state = pressed ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED};
|
||||
wlr_keyboard_notify_key(&s->keyboard, &ev);
|
||||
wlr_seat_keyboard_notify_modifiers(s->seat, &s->keyboard.modifiers);
|
||||
wlr_seat_keyboard_notify_key(s->seat, ev.time_msec, code, ev.state);
|
||||
if (code < BTN_MISC) {
|
||||
wlr_keyboard_notify_key(&s->keyboard, &ev);
|
||||
wlr_seat_keyboard_notify_modifiers(s->seat, &s->keyboard.modifiers);
|
||||
wlr_seat_keyboard_notify_key(s->seat, ev.time_msec, code, ev.state);
|
||||
} else {
|
||||
wlr_seat_pointer_notify_button(s->seat, ev.time_msec, code, ev.state);
|
||||
}
|
||||
}
|
||||
|
||||
// Keys from the input relay (physical keyboards): "key <evdev code> <1 press|0 release>".
|
||||
|
||||
Reference in new issue
Block a user