<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharSet="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>InputsController | pokemon-rogue-battle</title><metaname="description"content="Documentation for pokemon-rogue-battle"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="../assets/style.css"/><linkrel="stylesheet"href="../assets/highlight.css"/><scriptdefersrc="../assets/main.js"></script><scriptasyncsrc="../assets/icons.js"id="tsd-icons-script"></script><scriptasyncsrc="../assets/search.js"id="tsd-search-script"></script><scriptasyncsrc="../assets/navigation.js"id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme=localStorage.getItem("tsd-theme")||"os";document.body.style.display="none";setTimeout(()=>app?app.showPage():document.body.style.removeProperty("display"),500)</script><headerclass="tsd-page-toolbar"><divclass="tsd-toolbar-contents container"><divclass="table-cell"id="tsd-search"data-base=".."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget tsd-toolbar-icon search no-caption"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-search"></use></svg></label><inputtype="text"id="tsd-search-field"aria-label="Search"/></div><divclass="field"><divid="tsd-toolbar-links"></div></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="../index.html"class="title">pokemon-rogue-battle</a></div><divclass="table-cell"id="tsd-widgets"><ahref="#"class="tsd-widget tsd-toolbar-icon menu no-caption"data-toggle="menu"aria-label="Menu"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><divclass="container container-main"><divclass="col-content"><divclass="tsd-page-title"><ulclass="tsd-breadcrumb"><li><ahref="../index.html">pokemon-rogue-battle</a></li><li><ahref="../modules/inputs_controller.html">inputs-controller</a></li><li><ahref="inputs_controller.InputsController.html">InputsController</a></li></ul><h1>Class InputsController</h1></div><sectionclass="tsd-panel tsd-comment"><divclass="tsd-comment tsd-typography"><p>Manages and handles all input controls for the game, including keyboard and gamepad interactions.</p>
</div><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This class is designed to centralize input management across the game. It facilitates the setup,
configuration, and handling of all game inputs, making it easier to manage various input devices
such as keyboards and gamepads. The class provides methods for setting up input devices, handling
their events, and responding to changes in input state (e.g., button presses, releases).</p>
<p>The <code>InputsController</code> class also includes mechanisms to handle game focus events to ensure input
states are correctly reset and managed when the game loses or regains focus, maintaining robust
and responsive control handling throughout the game's lifecycle.</p>
<p>Key responsibilities include:</p>
<ul>
<li>Initializing and configuring gamepad and keyboard controls.</li>
<li>Emitting events related to specific input actions.</li>
<li>Responding to external changes such as gamepad connection/disconnection.</li>
<li>Managing game state transitions in response to input events, particularly focus loss and recovery.</li>
</ul>
<p>Usage of this class is intended to simplify input management across various parts of the game,
providing a unified interface for all input-related interactions.</p>
</div></section></div></details></section></section><sectionclass="tsd-panel-group tsd-member-group"><h2>Constructors</h2><sectionclass="tsd-panel tsd-member"><aid="constructor"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>constructor</span><ahref="#constructor"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="constructor.new_InputsController"class="tsd-anchor"></a><spanclass="tsd-kind-constructor-signature">new <wbr/>Inputs<wbr/>Controller</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">scene</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="inputs_controller.InputsController.html"class="tsd-signature-type tsd-kind-class">InputsController</a><ahref="#constructor.new_InputsController"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Initializes a new instance of the game control system, setting up initial state and configurations.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">scene</span>: <ahref="battle_scene.default.html"class="tsd-signature-type tsd-kind-class">default</a></span><divclass="tsd-comment tsd-typography"><p>The Phaser scene associated with this instance.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="inputs_controller.InputsController.html"class="tsd-signature-type tsd-kind-class">InputsController</a></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This constructor initializes the game control system with necessary setups for handling inputs.
It prepares an interactions array indexed by button identifiers and configures default states for each button.
Specific buttons like MENU and STATS are set not to repeat their actions.
It concludes by calling the <code>init</code> method to complete the setup.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">settingName</span>: <spanclass="tsd-signature-type">any</span></span><divclass="tsd-comment tsd-typography"><p>The name of the setting to swap.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">pressedButton</span>: <spanclass="tsd-signature-type">any</span></span><divclass="tsd-comment tsd-typography"><p>The button that was pressed.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">boolean</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L752">src/inputs-controller.ts:752</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="deactivatePressedKey"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>deactivate<wbr/>Pressed<wbr/>Key</span><ahref="#deactivatePressedKey"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="deactivatePressedKey.deactivatePressedKey-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">deactivate<wbr/>Pressed<wbr/>Key</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#deactivatePressedKey.deactivatePressedKey-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Deactivates all currently pressed keys and resets their interaction states.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is used to reset the state of all buttons within the <code>interactions</code> dictionary,
effectively deactivating any currently pressed keys. It performs the following actions:</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L625">src/inputs-controller.ts:625</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="delLastProcessedMovementTime"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>del<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><ahref="#delLastProcessedMovementTime"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="delLastProcessedMovementTime.delLastProcessedMovementTime-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">del<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">button</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#delLastProcessedMovementTime.delLastProcessedMovementTime-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Clears the last interaction for a specified button.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>The button for which to clear the interaction.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method resets the interaction details of the button, allowing it to be processed as a new input when pressed again.
If the button is not registered in the <code>interactions</code> dictionary, this method returns immediately, otherwise:</p>
<ul>
<li><code>pressTime</code> is cleared. This was previously storing the timestamp of when the button was initially pressed.</li>
<li><code>isPressed</code> is set to false, indicating that the button is no longer being pressed.</li>
<li><code>source</code> is set to null, which had been indicating the device from which the button input was originating.</li>
</ul>
<p>It releases the button lock, which prevents the button from being processed repeatedly until it's explicitly released.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L596">src/inputs-controller.ts:596</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="ensureKeyboardIsInit"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><ahref="#ensureKeyboardIsInit"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="ensureKeyboardIsInit.ensureKeyboardIsInit-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#ensureKeyboardIsInit.ensureKeyboardIsInit-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Ensures the keyboard is initialized by checking if there is an active configuration for the keyboard.
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L394">src/inputs-controller.ts:394</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="gamepadButtonDown"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Down</span><ahref="#gamepadButtonDown"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="gamepadButtonDown.gamepadButtonDown-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Down</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">pad</span>, <spanclass="tsd-kind-parameter">button</span>, <spanclass="tsd-kind-parameter">value</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#gamepadButtonDown.gamepadButtonDown-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Handles button press events on a gamepad. This method sets the gamepad as chosen on the first input if no gamepad is currently chosen.
It checks if gamepad support is enabled and if the event comes from the chosen gamepad. If so, it maps the button press to a specific
action using a custom configuration, emits an event for the button press, and records the time of the action.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">pad</span>: <spanclass="tsd-signature-type">Gamepad</span></span><divclass="tsd-comment tsd-typography"><p>The gamepad on which the button was pressed.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">button</span>: <spanclass="tsd-signature-type">Button</span></span><divclass="tsd-comment tsd-typography"><p>The specific button that was pressed.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">value</span>: <spanclass="tsd-signature-type">number</span></span><divclass="tsd-comment tsd-typography"><p>The intensity or value of the button press, if applicable.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L452">src/inputs-controller.ts:452</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="gamepadButtonUp"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Up</span><ahref="#gamepadButtonUp"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="gamepadButtonUp.gamepadButtonUp-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Up</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">pad</span>, <spanclass="tsd-kind-parameter">button</span>, <spanclass="tsd-kind-parameter">value</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#gamepadButtonUp.gamepadButtonUp-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Responds to a button release event on a gamepad by checking if the gamepad is supported and currently chosen.
If conditions are met, it identifies the configured action for the button, emits an event signaling the button release,
and clears the record of the button.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">pad</span>: <spanclass="tsd-signature-type">Gamepad</span></span><divclass="tsd-comment tsd-typography"><p>The gamepad from which the button was released.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">button</span>: <spanclass="tsd-signature-type">Button</span></span><divclass="tsd-comment tsd-typography"><p>The specific button that was released.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">value</span>: <spanclass="tsd-signature-type">number</span></span><divclass="tsd-comment tsd-typography"><p>The intensity or value of the button release, if applicable.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L486">src/inputs-controller.ts:486</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="getActiveConfig"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>get<wbr/>Active<wbr/>Config</span><ahref="#getActiveConfig"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getActiveConfig.getActiveConfig-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Active<wbr/>Config</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">device</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">any</span><ahref="#getActiveConfig.getActiveConfig-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Retrieves the active configuration for the currently chosen device.
It checks if a specific device ID is stored in configurations and returns it.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">device</span>: <ahref="../enums/enums_devices.Device.html"class="tsd-signature-type tsd-kind-enum">Device</a></span></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">any</span></h4><p>InterfaceConfig The configuration object for the active gamepad, or null if not set.</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L688">src/inputs-controller.ts:688</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="getConfig"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>get<wbr/>Config</span><ahref="#getConfig"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getConfig.getConfig-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Config</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">id</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="../interfaces/inputs_controller.InterfaceConfig.html"class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><ahref="#getConfig.getConfig-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Retrieves the configuration object for a gamepad based on its identifier. The method identifies specific gamepad models
based on substrings in the identifier and returns predefined configurations for recognized models.
If no specific configuration matches, it defaults to a generic gamepad configuration.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">id</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The identifier string of the gamepad.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="../interfaces/inputs_controller.InterfaceConfig.html"class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a></h4><p>InterfaceConfig The configuration object corresponding to the identified gamepad type.</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L512">src/inputs-controller.ts:512</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="getConfigKeyboard"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>get<wbr/>Config<wbr/>Keyboard</span><ahref="#getConfigKeyboard"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getConfigKeyboard.getConfigKeyboard-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Config<wbr/>Keyboard</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">id</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="../interfaces/inputs_controller.InterfaceConfig.html"class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><ahref="#getConfigKeyboard.getConfigKeyboard-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Retrieves the configuration object for a keyboard layout based on its identifier.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">id</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The identifier string of the keyboard layout.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="../interfaces/inputs_controller.InterfaceConfig.html"class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a></h4><p>InterfaceConfig The configuration object corresponding to the identified keyboard layout.</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L534">src/inputs-controller.ts:534</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="getGamepadsName"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>get<wbr/>Gamepads<wbr/>Name</span><ahref="#getGamepadsName"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getGamepadsName.getGamepadsName-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Gamepads<wbr/>Name</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">String</span><spanclass="tsd-signature-symbol">[]</span><ahref="#getGamepadsName.getGamepadsName-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Retrieves the identifiers of all connected gamepads, excluding any that are currently marked as disconnected.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">String</span><spanclass="tsd-signature-symbol">[]</span></h4><p>Array<String> An array of strings representing the IDs of the connected gamepads.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method configures event listeners for both gamepad and keyboard inputs.
It handles gamepad connections/disconnections and button press events, and ensures keyboard controls are set up.
Additionally, it manages the game's behavior when it loses focus to prevent unwanted game actions during this state.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L151">src/inputs-controller.ts:151</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="initChosenGamepad"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Gamepad</span><ahref="#initChosenGamepad"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="initChosenGamepad.initChosenGamepad-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Gamepad</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">gamepadName</span><spanclass="tsd-signature-symbol">?</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#initChosenGamepad.initChosenGamepad-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Initializes the chosen gamepad by setting its identifier in the local storage and updating the UI to reflect the chosen gamepad.
If a gamepad name is provided, it uses that as the chosen gamepad; otherwise, it defaults to the currently chosen gamepad.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><codeclass="tsd-tag ts-flagOptional">Optional</code><spanclass="tsd-kind-parameter">gamepadName</span>: <spanclass="tsd-signature-type">String</span></span><divclass="tsd-comment tsd-typography"><p>Optional parameter to specify the name of the gamepad to initialize as chosen.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L289">src/inputs-controller.ts:289</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="initChosenLayoutKeyboard"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><ahref="#initChosenLayoutKeyboard"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="initChosenLayoutKeyboard.initChosenLayoutKeyboard-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">layoutKeyboard</span><spanclass="tsd-signature-symbol">?</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#initChosenLayoutKeyboard.initChosenLayoutKeyboard-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Initializes the chosen keyboard layout by setting its identifier in the local storage and updating the UI to reflect the chosen layout.
If a layout name is provided, it uses that as the chosen layout; otherwise, it defaults to the currently chosen layout.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><codeclass="tsd-tag ts-flagOptional">Optional</code><spanclass="tsd-kind-parameter">layoutKeyboard</span>: <spanclass="tsd-signature-type">String</span></span><divclass="tsd-comment tsd-typography"><p>Optional parameter to specify the name of the keyboard layout to initialize as chosen.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L302">src/inputs-controller.ts:302</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="injectConfig"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>inject<wbr/>Config</span><ahref="#injectConfig"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="injectConfig.injectConfig-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">inject<wbr/>Config</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">selectedDevice</span>, <spanclass="tsd-kind-parameter">mappingConfigs</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#injectConfig.injectConfig-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Injects a custom mapping configuration into the configuration for a specific gamepad.
If the device does not have an existing configuration, it initializes one first.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">selectedDevice</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The identifier of the device to configure.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">mappingConfigs</span>: <spanclass="tsd-signature-type">any</span></span><divclass="tsd-comment tsd-typography"><p>The mapping configuration to apply to the device.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L730">src/inputs-controller.ts:730</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="isButtonLocked"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>is<wbr/>Button<wbr/>Locked</span><ahref="#isButtonLocked"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="isButtonLocked.isButtonLocked-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">is<wbr/>Button<wbr/>Locked</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">button</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">boolean</span><ahref="#isButtonLocked.isButtonLocked-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Checks if a specific button is currently locked.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>The button to check for a lock status.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">boolean</span></h4><p><code>true</code> if the button is locked, otherwise <code>false</code>.</p>
<divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is used to determine if a given button is currently prevented from being processed due to a lock.
It checks against two separate lock variables, allowing for up to two buttons to be locked simultaneously.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L649">src/inputs-controller.ts:649</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="keyboardKeyDown"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>keyboard<wbr/>Key<wbr/>Down</span><ahref="#keyboardKeyDown"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="keyboardKeyDown.keyboardKeyDown-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">keyboard<wbr/>Key<wbr/>Down</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">event</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#keyboardKeyDown.keyboardKeyDown-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Handles the keydown event for the keyboard.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L428">src/inputs-controller.ts:428</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="loseFocus"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>lose<wbr/>Focus</span><ahref="#loseFocus"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="loseFocus.loseFocus-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">lose<wbr/>Focus</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#loseFocus.loseFocus-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Handles actions to take when the game loses focus, such as deactivating pressed keys.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is triggered when the game or the browser tab loses focus. It ensures that any keys pressed are deactivated to prevent stuck keys affecting gameplay when the game is not active.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L195">src/inputs-controller.ts:195</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="onDisconnect"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>on<wbr/>Disconnect</span><ahref="#onDisconnect"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="onDisconnect.onDisconnect-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">on<wbr/>Disconnect</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">thisGamepad</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#onDisconnect.onDisconnect-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Handles the disconnection of a gamepad by adding its identifier to a list of disconnected gamepads.
This is necessary because Phaser retains memory of previously connected gamepads, and without tracking
disconnections, it would be impossible to determine the connection status of gamepads. This method ensures
that disconnected gamepads are recognized and can be appropriately hidden in the gamepad selection menu.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">thisGamepad</span>: <spanclass="tsd-signature-type">Gamepad</span></span><divclass="tsd-comment tsd-typography"><p>The gamepad that has been disconnected.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L318">src/inputs-controller.ts:318</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="onReconnect"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>on<wbr/>Reconnect</span><ahref="#onReconnect"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="onReconnect.onReconnect-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">on<wbr/>Reconnect</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">thisGamepad</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#onReconnect.onReconnect-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Updates the tracking of disconnected gamepads when a gamepad is reconnected.
It removes the reconnected gamepad's identifier from the <code>disconnectedGamepads</code> array,
effectively updating its status to connected.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">thisGamepad</span>: <spanclass="tsd-signature-type">Gamepad</span></span><divclass="tsd-comment tsd-typography"><p>The gamepad that has been reconnected.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L329">src/inputs-controller.ts:329</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="refreshGamepads"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>refresh<wbr/>Gamepads</span><ahref="#refreshGamepads"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="refreshGamepads.refreshGamepads-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">refresh<wbr/>Gamepads</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#refreshGamepads.refreshGamepads-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Refreshes and re-indexes the list of connected gamepads.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method updates the list of gamepads to exclude any that are undefined.
It corrects the index of each gamepad to account for any previously undefined entries,
ensuring that all gamepads are properly indexed and can be accurately referenced within the game.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L379">src/inputs-controller.ts:379</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="releaseButtonLock"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>release<wbr/>Button<wbr/>Lock</span><ahref="#releaseButtonLock"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="releaseButtonLock.releaseButtonLock-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">release<wbr/>Button<wbr/>Lock</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">button</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#releaseButtonLock.releaseButtonLock-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Releases a lock on a specific button, allowing it to be processed again.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>The button whose lock is to be released.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>has been held down long
enough to fire a repeated input. A button must claim the buttonLock before
firing a repeated input - this is to prevent multiple buttons from firing repeatedly.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>The button to lock.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method ensures that a button is not processed multiple times inadvertently.
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L662">src/inputs-controller.ts:662</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="setChosenGamepad"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Gamepad</span><ahref="#setChosenGamepad"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="setChosenGamepad.setChosenGamepad-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Gamepad</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">gamepad</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#setChosenGamepad.setChosenGamepad-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Sets the currently chosen gamepad and initializes related settings.
This method first deactivates any active key presses and then initializes the gamepad settings.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">gamepad</span>: <spanclass="tsd-signature-type">String</span></span><divclass="tsd-comment tsd-typography"><p>The identifier of the gamepad to set as chosen.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L222">src/inputs-controller.ts:222</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="setChosenKeyboardLayout"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><ahref="#setChosenKeyboardLayout"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="setChosenKeyboardLayout.setChosenKeyboardLayout-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">layoutKeyboard</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#setChosenKeyboardLayout.setChosenKeyboardLayout-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Sets the currently chosen keyboard layout and initializes related settings.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">layoutKeyboard</span>: <spanclass="tsd-signature-type">String</span></span><divclass="tsd-comment tsd-typography"><p>The identifier of the keyboard layout to set as chosen.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">value</span>: <spanclass="tsd-signature-type">boolean</span></span><divclass="tsd-comment tsd-typography"><p>A boolean indicating whether gamepad support should be enabled (true) or disabled (false).</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method toggles gamepad support. If disabled, it also ensures that all currently pressed gamepad buttons are deactivated to avoid stuck inputs.</p>
</div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/209a69d098375dcb1f5f5be4be1d674e3b3d585f/src/inputs-controller.ts#L207">src/inputs-controller.ts:207</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="setLastProcessedMovementTime"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>set<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><ahref="#setLastProcessedMovementTime"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="setLastProcessedMovementTime.setLastProcessedMovementTime-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">set<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">button</span>, <spanclass="tsd-kind-parameter">source</span><spanclass="tsd-signature-symbol">?</span>, <spanclass="tsd-kind-parameter">sourceName</span><spanclass="tsd-signature-symbol">?</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#setLastProcessedMovementTime.setLastProcessedMovementTime-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>This method updates the interaction state to reflect that the button is pressed.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">button</span>: <ahref="../enums/enums_buttons.Button.html"class="tsd-signature-type tsd-kind-enum">Button</a></span><divclass="tsd-comment tsd-typography"><p>The button for which to set the interaction.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">source</span>: <spanclass="tsd-signature-type">String</span><spanclass="tsd-signature-symbol"> = "keyboard"</span></span><divclass="tsd-comment tsd-typography"><p>The source of the input (defaults to 'keyboard'). This helps identify the origin of the input, especially useful in environments with multiple input devices.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><codeclass="tsd-tag ts-flagOptional">Optional</code><spanclass="tsd-kind-parameter">sourceName</span>: <spanclass="tsd-signature-type">String</span></span></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is responsible for updating the interaction state of a button within the <code>interactions</code> dictionary. If the button is not already registered, this method returns immediately.
When invoked, it performs the following updates:</p>
<ul>
<li><code>pressTime</code>: Sets this to the current time, representing when the button was initially pressed.</li>
<li><code>isPressed</code>: Marks the button as currently being pressed.</li>
<li><code>source</code>: Identifies the source device of the input, which can vary across different hardware (e.g., keyboard, gamepad).</li>
</ul>
<p>Additionally, this method locks the button (by calling <code>setButtonLock</code>) to prevent it from being re-processed until it is released, ensuring that each press is handled distinctly.</p>
It retrieves the names of all connected gamepads, sets up their configurations according to stored or default settings,
and ensures these configurations are saved. If the connected gamepad is the currently chosen one,
it reinitializes the chosen gamepad settings.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">thisGamepad</span>: <spanclass="tsd-signature-type">Gamepad</span></span><divclass="tsd-comment tsd-typography"><p>The gamepad that is being set up.</p>