Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Add some keysym mappings and move the keymap.rs file Add key location and some minor corrections Also add a `Meta` key (code) value. Use xkbcommon-dl rather than xkbcommon Hoist keyboard handling code from sctk into Winit Wire up the new events properly Fix creation of key value strings Use `xkb_keysym_to_utf8` rather than `xkb_state_key_get_utf8` to create key value strings, as the latter performs keysym transformations, while the former doesn't. Add missing keysym mapping I accidentally skipped over `XKB_KEY_Page_Down` while initially mapping keysyms. Fix `key_without_modifiers` I forgot about the offset between evdev keycodes and xkb keycodes. Feature-gate things which depend on memmap2 Be more consistent with what `keycode` means Improve key string handling Add initial X11 support Address compilation errors Improve debug printing of `NativeKeyCode` Hook up X11 XKB modifier keys Use XInput2 for regular key events Implement dead-key handling Remove unused module Update xkbcommon-dl Update xkbcommon-dl again Remove accidentally included attribute Use `as u32` to cast `i32`s to `u32`s Put more things behind the "wayland" feature Remove superfluous scope Separate out loading of the X11 keymap Wire up X11 IME support Use the currently active keyboard layout on X11 Enable keysym mapping for "Alt Graph" Actually respect keyboard layout changes 9486ac0 did not work for me Make `xkb_state` more internally consistent Improve the safety of `KbState` Make a decision on control characters and dead keys Store keycodes with X11's keycode offset Log an error if we can't select XKB events Remove superfluous call to `Vec::set_len` Send a warning if the server doesn't send a keymap Implement `KeyCodeExtScancode` on Wayland and X11 Implement `reset_dead_keys` (poorly) Split the native XKB keycode enum variant in two `XkbCode` now contains keycodes while `XkbSym` contains keysyms. This may change sooner rather than later. Add a TODO regarding the `ModifiersChanged` event. fix: meta mod key on focus handling for gnome/x11 This patch addresses an issue in the modifier key handling appearing on gnome/x11 while focussing a winit window using a meta/super/logo key shortcut. As soon as the window gained focus via a shortcut using a meta key, gnome/x11 reports a meta modifier as pressed in the focus event, even though it was just released. No key release events were sent afterwards, so the meta modifier remained "stuck" in the winit state. This patch refactors the modifier key handling following this goals: - Only rely on winit's own modifier state tracking for key and focus events, do not mix it with x11's modifier reporting - Track modifiers only via non-raw key events, so winit does not track modifier changes when not focussed - Integrate modifier handling with the synthetic key events mechanism in order to report release of all currently held modifiers when unfocussed and report set for all currently held modifiers when focussed. Remove the `XkbStateNotify` handler The only thing we did in response to said event is update the `xkb_state`, but we throw that away on every keypress anyway due to the keyeyboard layout change detection hack. This commit also removes associated code which let us recieve and react to the event in the first place. If a fix is ever introduced, then this commit ought to be reverted. X11: Only fetch virtual keyboard events from master devices We must not report virtual keyboard events for keys that were grabbed by other applications (XGrabKey, etc.). Since grabs only affect master devices, we must consume virtual events from master devices only. Revert "fix: meta mod key on focus handling for gnome/x11" It's not clear if this change is working properly This reverts commit 333c5bc. General clippy fixes and formatting Improve libxkbcommon string handling Add `WindowBuilder::transparent` This is required to help hardware accelerated libraries like glutin that accept WindowBuilder instead of RawWindowHandle, since the api to access builder properties directly was removed. Follow up to 44288f6. Fix doubled device events on X11 Fixes rust-windowing#2332 Don't reload the keymap on every keypress Turns out I was an idiot when initially working on this. Don't listen to XkbMapNotify This event appears to be subsumed by XkbNewKeyboardNotify when we start listening to XkbNewKeyboardNotify, although the documentation feels a little unclear on the matter. Use XkbStateNotify to track the active set of modifiers This commit retains the old code-path for doing this tracking in order to test for regressions introduced by this change. It appears that we manage to avoid any visible regressions due to having already removed the long since deprecated `modifiers` field from keyboard events, which hides the fact that using XkbStateNotify makes ModifiersChanged events arrive _after_ the WindowEvent for the keypress instead of between the DeviceEvent and the WindowEvent. Rip out the old code-path for modifier state tracking on X11 Rip out some vestigial parts In particular, this removes the X11_EVPROC_NEXT_COMPOSE hack now that our IME event code-path seems to ignore compose sequences. Deal with various TODOs
- Loading branch information