@leafer-ui/interaction 1.0.0-rc.25 → 1.0.0-rc.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interaction",
3
- "version": "1.0.0-rc.25",
3
+ "version": "1.0.0-rc.26",
4
4
  "description": "@leafer-ui/interaction",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,12 +22,12 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.0-rc.25",
26
- "@leafer-ui/draw": "1.0.0-rc.25",
27
- "@leafer-ui/event": "1.0.0-rc.25"
25
+ "@leafer/core": "1.0.0-rc.26",
26
+ "@leafer-ui/draw": "1.0.0-rc.26",
27
+ "@leafer-ui/event": "1.0.0-rc.26"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.0.0-rc.25",
31
- "@leafer-ui/interface": "1.0.0-rc.25"
30
+ "@leafer/interface": "1.0.0-rc.26",
31
+ "@leafer-ui/interface": "1.0.0-rc.26"
32
32
  }
33
33
  }
@@ -235,6 +235,8 @@ export class InteractionBase implements IInteraction {
235
235
  // key
236
236
 
237
237
  public keyDown(data: IKeyEvent): void {
238
+ if (!this.config.keyEvent) return
239
+
238
240
  const { code } = data
239
241
  if (!this.downKeyMap[code]) {
240
242
  this.downKeyMap[code] = true
@@ -250,6 +252,8 @@ export class InteractionBase implements IInteraction {
250
252
  }
251
253
 
252
254
  public keyUp(data: IKeyEvent): void {
255
+ if (!this.config.keyEvent) return
256
+
253
257
  const { code } = data
254
258
  this.downKeyMap[code] = false
255
259
  Keyboard.setUpCode(code)
package/src/config.ts CHANGED
@@ -19,5 +19,6 @@ export const config: IInteractionConfig = {
19
19
  swipeDistance: 20,
20
20
  preventDefaultMenu: true
21
21
  },
22
- cursor: {}
22
+ cursor: {},
23
+ keyEvent: true
23
24
  }