mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-28 10:37:41 +00:00
fix(web): modipress+multitap handling
This commit is contained in:
parent
2a21f9a447
commit
f29888fa3b
2 changed files with 34 additions and 2 deletions
|
|
@ -77,6 +77,9 @@ export default class Multitap implements GestureHandler {
|
|||
case 'multitap-end':
|
||||
case 'simple-tap':
|
||||
return;
|
||||
case 'modipress-multitap-lock-transition':
|
||||
this.modipress?.setLocked();
|
||||
return;
|
||||
// Once a multitap starts, it's better to emit keys on keydown; that way,
|
||||
// if a user holds long, they get what they see if they decide to stop,
|
||||
// but also have time to decide if they want to continue to what's next.
|
||||
|
|
|
|||
|
|
@ -219,7 +219,8 @@ export function gestureSetForLayout(layerGroup: OSKLayerGroup, params: GesturePa
|
|||
ModipressEndModel,
|
||||
ModipressMultitapTransitionModel,
|
||||
withKeySpecFiltering(modipressMultitapStartModel(params), 0),
|
||||
modipressMultitapEndModel(params)
|
||||
modipressMultitapEndModel(params),
|
||||
modipressMultitapLockModel()
|
||||
];
|
||||
|
||||
const defaultSet = [
|
||||
|
|
@ -1054,9 +1055,37 @@ export function modipressMultitapEndModel(params: GestureParams): GestureModel<a
|
|||
rejectionActions: {
|
||||
timer: {
|
||||
type: 'replace',
|
||||
replace: 'modipress-end'
|
||||
replace: 'modipress-multitap-lock-transition'
|
||||
},
|
||||
path: {
|
||||
type: 'replace',
|
||||
replace: 'modipress-multitap-lock-transition'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function modipressMultitapLockModel(): GestureModel<any> {
|
||||
return {
|
||||
id: 'modipress-multitap-lock-transition',
|
||||
resolutionPriority: 5,
|
||||
contacts: [
|
||||
// This exists as an intermediate state to transition from
|
||||
// a modipress-multitap into a plain modipress without further
|
||||
// multitap rota behavior.
|
||||
{
|
||||
model: {
|
||||
...InstantContactResolutionModel,
|
||||
pathResolutionAction: 'resolve' // doesn't end the path; just lets it continue.
|
||||
},
|
||||
}
|
||||
],
|
||||
resolutionAction: {
|
||||
type: 'chain',
|
||||
next: 'modipress-end',
|
||||
selectionMode: 'modipress',
|
||||
item: 'none'
|
||||
}
|
||||
};
|
||||
}
|
||||
// #endregion
|
||||
Loading…
Add table
Reference in a new issue