diff --git a/src/app/App.tsx b/src/app/App.tsx index 6efdeaf1..649027a7 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -3447,7 +3447,10 @@ export function App({ store, initialStatusMessage }: AppProps) { return; } - if (event.code === "Escape") { + if ( + event.code === "Escape" && + playerStartKeyboardCaptureAction !== "clearTarget" + ) { setPlayerStartKeyboardCaptureAction(null); setStatusMessage("Cancelled Player Start key capture."); return; @@ -8925,6 +8928,10 @@ export function App({ store, initialStatusMessage }: AppProps) { navigationMode, interactionReachMeters, interactionAngleDegrees, + allowLookInputTargetSwitch: + playerStartAllowLookInputTargetSwitchDraft, + targetButtonCyclesActiveTarget: + playerStartTargetButtonCyclesActiveTargetDraft, movementTemplate, inputBindings, collider: { @@ -8958,6 +8965,21 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; + const beginPlayerStartKeyboardCapture = (action: PlayerStartInputAction) => { + if (playerStartKeyboardCaptureAction === action) { + setPlayerStartKeyboardCaptureAction(null); + setStatusMessage("Cancelled Player Start key capture."); + return; + } + + setPlayerStartKeyboardCaptureAction(action); + setStatusMessage( + action === "clearTarget" + ? `Press any key or mouse button for ${getPlayerStartInputActionLabel(action)}. Click the binding button again to cancel.` + : `Press any key or mouse button for ${getPlayerStartInputActionLabel(action)}. Press Escape to cancel.` + ); + }; + const handlePlayerStartKeyboardBindingChange = ( action: PlayerStartInputAction, nextCode: PlayerStartKeyboardBindingCode