mirror of
https://github.com/storytold/winit.git
synced 2026-11-28 01:13:21 +01:00
On X11, use events modifiers to detect state
While there's a separate event to deliver modifiers for keyboard, unfortunately, it's not even remotely reflects the modifiers state. Thus use events along side regular modifier updates to correctly detect the state. Also, apply the modifiers from the regular key event by converting their state to xkb modifiers state. Links: https://github.com/alacritty/alacritty/issues/7549 Closes: #3388
This commit is contained in:
1 parent
9c033ce101
commit
cb855b87cc
11 files changed
+1167
-84
No files matched your search
@@ -521,7 +521,7 @@ impl Window {
|
||||
|
||||
#[inline]
|
||||
pub fn reset_dead_keys(&self) {
|
||||
common::xkb_state::reset_dead_keys()
|
||||
common::xkb::reset_dead_keys()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -659,11 +659,11 @@ impl KeyEventExtModifierSupplement for KeyEvent {
|
||||
|
||||
impl PhysicalKeyExtScancode for PhysicalKey {
|
||||
fn from_scancode(scancode: u32) -> PhysicalKey {
|
||||
common::keymap::scancode_to_keycode(scancode)
|
||||
common::xkb::scancode_to_keycode(scancode)
|
||||
}
|
||||
|
||||
fn to_scancode(self) -> Option<u32> {
|
||||
common::keymap::physicalkey_to_scancode(self)
|
||||
common::xkb::physicalkey_to_scancode(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user