Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Kate
ecdf560dff
Fix altgr conflicting with keybindings 2025-08-13 15:48:19 +02:00

View file

@ -1452,9 +1452,18 @@ fn is_virtual_key_pressed(vkey: VIRTUAL_KEY) -> bool {
#[inline] #[inline]
pub(crate) fn current_modifiers() -> Modifiers { pub(crate) fn current_modifiers() -> Modifiers {
let is_altgr = is_virtual_key_pressed(VK_RMENU) && is_virtual_key_pressed(VK_CONTROL);
Modifiers { Modifiers {
control: is_virtual_key_pressed(VK_CONTROL), control: if is_altgr {
alt: is_virtual_key_pressed(VK_MENU), false
} else {
is_virtual_key_pressed(VK_CONTROL)
},
alt: if is_altgr {
false
} else {
is_virtual_key_pressed(VK_MENU)
},
shift: is_virtual_key_pressed(VK_SHIFT), shift: is_virtual_key_pressed(VK_SHIFT),
platform: is_virtual_key_pressed(VK_LWIN) || is_virtual_key_pressed(VK_RWIN), platform: is_virtual_key_pressed(VK_LWIN) || is_virtual_key_pressed(VK_RWIN),
function: false, function: false,