Map XK_Caps_Lock to VirtualKeyCode::Capital (#1864)

This allows applications to handle events for the caps lock key under X11
This commit is contained in:
Aaron Hill 2022-06-23 10:59:04 -05:00 committed by GitHub
parent 64c1d4c5bb
commit 8646cbc9f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre
# Unreleased
- On X11, fix events for caps lock key not being sent
- Build docs on `docs.rs` for iOS and Android as well.
- **Breaking:** Removed the `WindowAttributes` struct, since all its functionality is accessible from `WindowBuilder`.
- Added `WindowBuilder::transparent` getter to check if the user set `transparent` attribute.

View file

@ -161,7 +161,7 @@ pub fn keysym_to_element(keysym: libc::c_uint) -> Option<VirtualKeyCode> {
ffi::XK_Shift_R => VirtualKeyCode::RShift,
ffi::XK_Control_L => VirtualKeyCode::LControl,
ffi::XK_Control_R => VirtualKeyCode::RControl,
//ffi::XK_Caps_Lock => VirtualKeyCode::Caps_lock,
ffi::XK_Caps_Lock => VirtualKeyCode::Capital,
//ffi::XK_Shift_Lock => VirtualKeyCode::Shift_lock,
//ffi::XK_Meta_L => VirtualKeyCode::Meta_l,
//ffi::XK_Meta_R => VirtualKeyCode::Meta_r,