mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-23 16:17:40 +00:00
Merge pull request #4954 from keymanapp/fix/web/subkey-suggestions
fix(web): fixes subkey lookup for fat-finger processing
This commit is contained in:
commit
bda0171448
2 changed files with 24 additions and 1 deletions
|
|
@ -32,6 +32,8 @@ namespace com.keyman.keyboards {
|
|||
proportionalX: number;
|
||||
proportionalWidth: number;
|
||||
|
||||
sk?: ActiveKey[];
|
||||
|
||||
// Keeping things simple here, as this was added LATE in 14.0 beta.
|
||||
// Could definitely extend in the future to instead return an object
|
||||
// that denotes the 'nature' of the key.
|
||||
|
|
@ -219,6 +221,18 @@ namespace com.keyman.keyboards {
|
|||
|
||||
return Lkc;
|
||||
}
|
||||
|
||||
public getSubkey(id: string): ActiveKey {
|
||||
if(this.sk) {
|
||||
for(let key of this.sk) {
|
||||
if(key.id == id) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class ActiveRow implements LayoutRow {
|
||||
|
|
@ -570,7 +584,13 @@ namespace com.keyman.keyboards {
|
|||
keyId = keyId.replace(this.id + '-', '');
|
||||
}
|
||||
|
||||
return this.keyMap[keyId];
|
||||
let idComponents = keyId.split('::');
|
||||
if(idComponents.length > 1) {
|
||||
let baseKey = this.keyMap[idComponents[0]];
|
||||
return baseKey.getSubkey(idComponents[1]);
|
||||
} else {
|
||||
return this.keyMap[keyId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1090,6 +1090,9 @@ namespace com.keyman.osk {
|
|||
if(popupKeyID == baseKeyID) {
|
||||
baseKeyMass += popupKeyMass;
|
||||
popupKeyMass = 0;
|
||||
} else {
|
||||
// We namespace it so that lookup operations know to find it via its base key.
|
||||
popupKeyID = `${baseKeyID}::${popupKeyID}`;
|
||||
}
|
||||
|
||||
// Compute the normalization factor
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue