client: keyboard shortcut issues

This commit is contained in:
jean-emmanuel 2023-05-13 11:19:56 +02:00
parent 59689d8f16
commit 5b981996fd
3 changed files with 10 additions and 5 deletions

View file

@ -6,7 +6,7 @@
- multixy: doubleTap not working on touch devices
- button: `x` and `y` variables not passed to `onValue` when `doubleTap` is true on touch devices
- advanced syntax: update issue with clones using their own value in their properties
- client: minor keyboard shortcut issues
## 1.24.2

View file

@ -521,7 +521,12 @@ class Editor {
leftUiSidePanel.enable()
rightUiSidePanel.enable()
// keyboardJS hack: prevent releaseAllKeys when switching context
var locale = keyboardJS._locale
keyboardJS._locale = null
keyboardJS.setContext('editing')
keyboardJS._locale = locale
this.oscContainer.addEventListener('mousemove', this.mouveMoveHandler)
this.oscContainer.addEventListener('mouseleave', this.mouveLeaveHandler)
@ -538,7 +543,11 @@ class Editor {
document.body.classList.add('editor-disabled')
document.body.classList.remove('editor-enabled')
// keyboardJS hack: prevent releaseAllKeys when switching context
var locale = keyboardJS._locale
keyboardJS._locale = null
keyboardJS.setContext('global')
keyboardJS._locale = locale
this.oscContainer.removeEventListener('mousemove', this.mouveMoveHandler)
this.oscContainer.removeEventListener('mouseleave', this.mouveLeaveHandler)

View file

@ -6,10 +6,6 @@ var html = require('nanohtml'),
MENU_CONTAINER
// monkey patch keyboardJS to prevent loosing track of pressed keys while
// switching contexts. Works as long as we don't call reset() or pause()
keyboardJS.releaseAllKeys = ()=>{}
class ContextMenu extends UiWidget {
constructor(options={}){