Skip to content

Commit

Permalink
Merge pull request #11216 from keymanapp/fix/web/longpress-up-flick-p…
Browse files Browse the repository at this point in the history
…riority
  • Loading branch information
jahorton authored Apr 12, 2024
2 parents ab0d225 + b4ed832 commit 8052134
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion web/src/engine/osk/src/input/gestures/specsForLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ export function specialKeyEndModel(params: GestureParams): GestureModel<any> {
export function longpressModel(params: GestureParams, allowShortcut: boolean, allowRoaming: boolean): GestureModel<any> {
const base: GestureModel<any> = {
id: 'longpress',
resolutionPriority: 0,
// Needs to beat flick-start priority.
resolutionPriority: 4,
contacts: [
{
model: {
Expand Down
7 changes: 6 additions & 1 deletion web/src/engine/osk/src/visualKeyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,13 @@ export default class VisualKeyboard extends EventEmitter<EventMap> implements Ke
const paddingZone = this.gestureEngine.config.maxRoamingBounds as PaddedZoneSource;
paddingZone.updatePadding([-0.333 * this.currentLayer.rowHeight]);

/*
Note: longpress.flickDist needs to be no greater than flick.startDist.
Otherwise, the longpress up-flick shortcut will not work on keys that
support flick gestures. (Such as sil_euro_latin 3.0+)
*/
this.gestureParams.longpress.flickDist = 0.25 * this.currentLayer.rowHeight;
this.gestureParams.flick.startDist = 0.15 * this.currentLayer.rowHeight;
this.gestureParams.flick.startDist = 0.25 * this.currentLayer.rowHeight;
this.gestureParams.flick.dirLockDist = 0.35 * this.currentLayer.rowHeight;
this.gestureParams.flick.triggerDist = 0.75 * this.currentLayer.rowHeight;
}
Expand Down

0 comments on commit 8052134

Please sign in to comment.