mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-11 08:27:27 +00:00
Merge pull request #11871 from keymanapp/fix/web/cherry-pick/simple-tap-fat-fingering
fix(web): use fat-finger data with simple keypresses 🍒 🏠
This commit is contained in:
commit
4224dc6ac2
2 changed files with 7 additions and 2 deletions
|
|
@ -80,7 +80,12 @@ export function distributionFromDistanceMaps(squaredDistMaps: Map<ActiveKeyBase,
|
|||
for(let key of squaredDistMap.keys()) {
|
||||
// We've found that in practice, dist^-4 seems to work pretty well. (Our input has dist^2.)
|
||||
// (Note: our rule of thumb here has only been tested for layout-based distances.)
|
||||
const entry = 1 / (Math.pow(squaredDistMap.get(key), 2) + 1e-6); // Prevent div-by-0 errors.
|
||||
//
|
||||
// The 3e-5 fudge-factor may seem a bit high, but it has two purposes:
|
||||
// 1. Prevent div-by-0 errors
|
||||
// 2. Ensures that the main key's probability doesn't get SO high that we don't
|
||||
// consider correcting to immediate neighbors, even if perfectly accurate.
|
||||
const entry = 1 / (Math.pow(squaredDistMap.get(key), 2) + 3e-5);
|
||||
totalMass += entry;
|
||||
|
||||
// In case of duplicate key IDs; this can occur if multiple sets are specified.
|
||||
|
|
|
|||
|
|
@ -637,7 +637,7 @@ export default class VisualKeyboard extends EventEmitter<EventMap> implements Ke
|
|||
try {
|
||||
shouldLockLayer && this.lockLayer(true);
|
||||
// Once the best coord to use for fat-finger calculations has been determined:
|
||||
keyResult = this.modelKeyClick(gestureStage.item, coord);
|
||||
keyResult = this.modelKeyClick(gestureStage.item, coord, correctionKeyDistribution);
|
||||
} finally {
|
||||
shouldLockLayer && this.lockLayer(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue