[fix] Shift key code / nudge (#1537)
Fix key code when pressing Shift, which fixes nudging. ### Change Type - [x] `patch` — Bug Fix ### Test Plan 1. use the shift key to nudge things ### Release Notes - Fix shift key nudging
This commit is contained in:
parent
66b3de4a03
commit
b89612bdb7
3 changed files with 4 additions and 2 deletions
|
@ -3981,6 +3981,8 @@ export class Editor extends EventEmitter<TLEventMap> {
|
||||||
}
|
}
|
||||||
case 'keyboard': {
|
case 'keyboard': {
|
||||||
// please, please
|
// please, please
|
||||||
|
if (info.key === 'ShiftRight') info.key = 'ShiftLeft'
|
||||||
|
if (info.key === 'AltRight') info.key = 'AltLeft'
|
||||||
if (info.code === 'ControlRight') info.code = 'ControlLeft'
|
if (info.code === 'ControlRight') info.code = 'ControlLeft'
|
||||||
|
|
||||||
switch (info.name) {
|
switch (info.name) {
|
||||||
|
|
|
@ -161,7 +161,7 @@ export class Idle extends StateNode {
|
||||||
// We want to use the "actual" shift key state,
|
// We want to use the "actual" shift key state,
|
||||||
// not the one that's in the editor.inputs.shiftKey,
|
// not the one that's in the editor.inputs.shiftKey,
|
||||||
// because that one uses a short timeout on release
|
// because that one uses a short timeout on release
|
||||||
const shiftKey = keys.has('Shift')
|
const shiftKey = keys.has('ShiftLeft')
|
||||||
|
|
||||||
const delta = new Vec2d(0, 0)
|
const delta = new Vec2d(0, 0)
|
||||||
|
|
||||||
|
|
|
@ -424,7 +424,7 @@ export class Idle extends StateNode {
|
||||||
// We want to use the "actual" shift key state,
|
// We want to use the "actual" shift key state,
|
||||||
// not the one that's in the editor.inputs.shiftKey,
|
// not the one that's in the editor.inputs.shiftKey,
|
||||||
// because that one uses a short timeout on release
|
// because that one uses a short timeout on release
|
||||||
const shiftKey = keys.has('Shift')
|
const shiftKey = keys.has('ShiftLeft')
|
||||||
|
|
||||||
const delta = new Vec2d(0, 0)
|
const delta = new Vec2d(0, 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue