core: layout: check if new key is supported when modifiers are updated

Some modifiers update key values. If the old values are unsupported
(e.g. "¢") but the new values are supported (e.g. "c"), the keyboard
should let the user press the new value. Check if the new key value
is supported instead of the old one.
This commit is contained in:
Richard Acayan 2025-03-28 22:27:21 -04:00
parent 94e242af17
commit a58f567715
No known key found for this signature in database
GPG key ID: 0346F4894879DB73

View file

@ -391,7 +391,7 @@ impl Part {
val = Self::modify_shift_label(&val); val = Self::modify_shift_label(&val);
} }
let key_supp = kbd.key_supported(self.val.0); let key_supp = kbd.key_supported(val.0);
self.key_avail = val.0 != Keysym::NoSymbol && key_supp; self.key_avail = val.0 != Keysym::NoSymbol && key_supp;
self.text_avail = text_avail && Self::keyvalue_has_text(&val); self.text_avail = text_avail && Self::keyvalue_has_text(&val);
self.val = val; self.val = val;