[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
pull/1539/head
Steve Ruiz 2023-06-06 12:49:17 +01:00 zatwierdzone przez GitHub
rodzic 66b3de4a03
commit b89612bdb7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -3981,6 +3981,8 @@ export class Editor extends EventEmitter<TLEventMap> {
}
case 'keyboard': {
// please, please
if (info.key === 'ShiftRight') info.key = 'ShiftLeft'
if (info.key === 'AltRight') info.key = 'AltLeft'
if (info.code === 'ControlRight') info.code = 'ControlLeft'
switch (info.name) {

Wyświetl plik

@ -161,7 +161,7 @@ export class Idle extends StateNode {
// We want to use the "actual" shift key state,
// not the one that's in the editor.inputs.shiftKey,
// 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)

Wyświetl plik

@ -424,7 +424,7 @@ export class Idle extends StateNode {
// We want to use the "actual" shift key state,
// not the one that's in the editor.inputs.shiftKey,
// 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)