Skip to content

Commit

Permalink
feat(web): achieves desktop simple-tap integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorton committed Oct 2, 2023
1 parent 1e06f2f commit 0006296
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 303 deletions.
3 changes: 2 additions & 1 deletion web/src/engine/osk/src/input/gestures/browser/subkeyPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import VisualKeyboard from '../../../visualKeyboard.js';
import InputEventCoordinate from '../../../input/inputEventCoordinate.js';

import { DeviceSpec, KeyEvent } from '@keymanapp/keyboard-processor';
import { InputSample } from '@keymanapp/gesture-recognizer';

/**
* Represents a 'realized' longpress gesture's default implementation
Expand Down Expand Up @@ -113,7 +114,7 @@ export default class SubkeyPopup implements RealizedGesture {
}
}

finalize(input: InputEventCoordinate) {
finalize(input: InputSample<KeyElement>) {
if(this.resolver) {
let keyEvent: KeyEvent = null;
if(this.currentSelection) {
Expand Down
6 changes: 0 additions & 6 deletions web/src/engine/osk/src/input/gestures/specsForKeyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ type GestureModel = specs.GestureModel<KeyElement>;
export const LongpressModel: GestureModel = {
id: 'longpress',
resolutionPriority: 0,
itemPriority: 0,
contacts: [
{
model: {
Expand Down Expand Up @@ -203,7 +202,6 @@ export const LongpressModel: GestureModel = {
export const MultitapModel: GestureModel = {
id: 'multitap',
resolutionPriority: 2,
itemPriority: 1,
contacts: [
{
model: {
Expand Down Expand Up @@ -245,7 +243,6 @@ export const MultitapModel: GestureModel = {
export const SimpleTapModel: GestureModel = {
id: 'simple-tap',
resolutionPriority: 1,
itemPriority: 0,
contacts: [
{
model: {
Expand Down Expand Up @@ -275,7 +272,6 @@ export const SimpleTapModel: GestureModel = {
export const SubkeySelectModel: GestureModel = {
id: 'subkey-select',
resolutionPriority: 0,
itemPriority: 0,
contacts: [
{
model: {
Expand Down Expand Up @@ -304,7 +300,6 @@ export const SubkeySelectModel: GestureModel = {
export const ModipressStartModel: GestureModel = {
id: 'modipress-start',
resolutionPriority: 5,
itemPriority: 0,
contacts: [
{
model: {
Expand Down Expand Up @@ -338,7 +333,6 @@ export const ModipressStartModel: GestureModel = {
export const ModipressEndModel: GestureModel = {
id: 'modipress-end',
resolutionPriority: 5,
itemPriority: 0,
contacts: [
{
model: {
Expand Down
8 changes: 3 additions & 5 deletions web/src/engine/osk/src/keyboard-layout/oskLayerGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ export default class OSKLayerGroup {

// Kind of WET with VisualKeyboard.updateState, but oh well.
let priorLayer: OSKLayer = null;
if(layer.element.style.display != 'block') {
if(layer.element.style.display == 'block') {
priorLayer = layer;
} else {
for(let id in this.layers) {
if(id == layerId) {
continue;
}

if(this.layers[id].element.style.display == 'block') {
priorLayer = this.layers[id];
}
Expand Down
Loading

0 comments on commit 0006296

Please sign in to comment.