-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipc: add an input event #4342
ipc: add an input event #4342
Conversation
7a0d9ff
to
b9ff4b3
Compare
This is ready for review. I kept the |
This adds an ipc event related to input devices. Currently the following changes are supported: - added: when an input device becomes available - removed: when an input device is no longer available - xkb_keymap_changed: (keyboards only) the keymap changed - xkb_layout_changed: (keyboards only) the effective layout changed
This adds a libinput_config change type to the input event for when the libinput config for a device changes In order for this to be possible to track, the libinput config code had to be refactored. It is now extracted into a separate file to isolate it from the rest of the input management code.
b9ff4b3
to
fb8b373
Compare
@@ -1371,6 +1371,9 @@ available: | |||
|- 0x80000014 | |||
: bar_status_update | |||
: Send when the visibility of a bar should change due to a modifier | |||
|- 0x80000015 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since i3 won't implement such an event, it may be wise to leave 0x80000015 for a future i3 event, and choose a much higher event code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bar_status_update
is also Sway specific. I just added this one right after. Should they both be changed?
@@ -603,8 +608,23 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
} | |||
} | |||
|
|||
bool keymap_changed = false; | |||
bool effective_layout_changed = keyboard->effective_layout != 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure I understand the logic here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, nevermind. It's the effective layout that gets reset.
However if the keymap changed the effective layout changes too, even if effective_layout
is still zero. The effective layout depends on the keymap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but if the effective layout is 0 before and after, then either the entire keymap changed or the keymap is identical and there is no change to the effective layout. See #4343 for a follow-up for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, those two comments are just me being confused. This LGTM, thanks!
Closes #4334
This adds an ipc event related to input devices. Currently the
following changes are supported: