core: button: only emit modifier keys that do not change the layout
Most future modifier keys will be accents that wouldn't be represented with an actual key press. Only emit modifier keys as key presses if they are of the other type (Ctrl, Alt, Shift).
This commit is contained in:
parent
ba9137d1f1
commit
1992b22ca1
1 changed files with 2 additions and 2 deletions
|
|
@ -239,11 +239,11 @@ impl<D: Display, K: Keyboard> Button<D, K> {
|
||||||
if self.modifiers[modifier - 1] == old {
|
if self.modifiers[modifier - 1] == old {
|
||||||
self.modifiers[modifier - 1] = new;
|
self.modifiers[modifier - 1] = new;
|
||||||
|
|
||||||
if new == ModState::Released {
|
if new == ModState::Released && !Layout::is_keysym_modifier(modifier) {
|
||||||
self.kbd.release(Layout::modifier_keysym(modifier));
|
self.kbd.release(Layout::modifier_keysym(modifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
if old == ModState::Released {
|
if old == ModState::Released && !Layout::is_keysym_modifier(modifier) {
|
||||||
self.kbd.press(Layout::modifier_keysym(modifier));
|
self.kbd.press(Layout::modifier_keysym(modifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue