Merge pull request #10745 from keymanapp/fix/web/no-modipress-if-subkeys

fix(web): disables modipress for layer-switch keys with subkeys
This commit is contained in:
Joshua Horton 2024-02-19 08:38:26 +07:00 committed by GitHub
commit 5884ed6a39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,8 +153,16 @@ function buildDistFromKeyCentroidFunctor(key: KeyElement) {
export function keySupportsModipress(key: KeyElement) {
const keySpec = key.key.spec;
// A key cannot reasonably support both longpresses and modipresses.
// It'd be quite ugly to overlay the subkey menu over the new layer during a modipress.
if(keySpec.sk) {
return false;
}
const modifierKeyIds = ['K_SHIFT', 'K_ALT', 'K_CTRL', 'K_NUMERALS', 'K_SYMBOLS', 'K_CURRENCIES'];
for(const modKeyId of modifierKeyIds) {
if(keySpec.id == modKeyId) {
return true;
}