Skip to content

Commit

Permalink
feat(controls): add meta key support in state controls
Browse files Browse the repository at this point in the history
  • Loading branch information
jailln committed Jan 24, 2024
1 parent 7fae54c commit 74f8b50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Controls/StateControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const CONTROL_KEYS = {
SPACE: 32,
SHIFT: 16,
CTRL: 17,
META: 91,
S: 83,
};

Expand Down Expand Up @@ -332,6 +333,8 @@ class StateControl extends THREE.EventDispatcher {
this._currentKeyPressed = CONTROL_KEYS.CTRL;
} else if (event.shiftKey) {
this._currentKeyPressed = CONTROL_KEYS.SHIFT;
} else if (event.metaKey) {
this._currentKeyPressed = CONTROL_KEYS.META;
}
}
this.currentState = this.inputToState(
Expand Down

0 comments on commit 74f8b50

Please sign in to comment.