mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
Implement keyboard input pause for text entry in FlagStationMinigame
- Added functionality to disable WASD key capture during text input, enhancing user experience. - Implemented a fallback mechanism to dynamically import the pauseKeyboardInput method if not available on the window object, ensuring compatibility across different environments.
This commit is contained in:
@@ -517,6 +517,20 @@ export class FlagStationMinigame extends MinigameScene {
|
||||
start() {
|
||||
super.start();
|
||||
console.log('[FlagStation] Started with', this.expectedFlags.length, 'expected flags');
|
||||
|
||||
// Disable WASD key capture from main game so text input works properly
|
||||
if (window.pauseKeyboardInput) {
|
||||
window.pauseKeyboardInput();
|
||||
console.log('[FlagStation] Paused keyboard input for text entry');
|
||||
} else {
|
||||
// Fallback to dynamic import if not available on window
|
||||
import('../../../js/core/player.js').then(module => {
|
||||
if (module.pauseKeyboardInput) {
|
||||
module.pauseKeyboardInput();
|
||||
console.log('[FlagStation] Paused keyboard input for text entry (via import)');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user