Skip to content

Commit

Permalink
fix: isSpacePressing shouldn't be false when pressing shift(close #159)
Browse files Browse the repository at this point in the history
  • Loading branch information
F-star committed Jun 14, 2024
1 parent 3487f62 commit e4ab846
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/host_event_manager/host_event_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export class HostEventManager {
this.isCtrlPressing = event.ctrlKey;
this.isAltPressing = event.altKey;
this.isCommandPressing = event.metaKey;
this.isSpacePressing = event.code === 'Space' && event.type === 'keydown';
if (event.code === 'Space') {
this.isSpacePressing = event.type === 'keydown';
}

if (prevShift !== this.isShiftPressing) {
this.eventEmitter.emit('shiftToggle', this.isShiftPressing);
Expand Down

0 comments on commit e4ab846

Please sign in to comment.