<!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"><h4class="tsd-anchor-link"><aid="Remarks"class="tsd-anchor"></a>Remarks<ahref="#Remarks"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This class is designed to centralize input management across the game. It facilitates the setup,
</div></section></div></details></section></section><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Constructors"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><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"><h4class="tsd-anchor-link"><aid="Remarks-1"class="tsd-anchor"></a>Remarks<ahref="#Remarks-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This constructor initializes the game control system with necessary setups for handling inputs.
</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L590">src/inputs-controller.ts:590</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.</p>
</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L513">src/inputs-controller.ts:513</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L342">src/inputs-controller.ts:342</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L404">src/inputs-controller.ts:404</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L452">src/inputs-controller.ts:452</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L526">src/inputs-controller.ts:526</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L480">src/inputs-controller.ts:480</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L502">src/inputs-controller.ts:502</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><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L136">src/inputs-controller.ts:136</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.
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><codeclass="tsd-tag">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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L237">src/inputs-controller.ts:237</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.
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><codeclass="tsd-tag">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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L250">src/inputs-controller.ts:250</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L381">src/inputs-controller.ts:381</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"><h4class="tsd-anchor-link"><aid="Remarks-3"class="tsd-anchor"></a>Remarks<ahref="#Remarks-3"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L181">src/inputs-controller.ts:181</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L266">src/inputs-controller.ts:266</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.
</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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L277">src/inputs-controller.ts:277</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"><h4class="tsd-anchor-link"><aid="Remarks-4"class="tsd-anchor"></a>Remarks<ahref="#Remarks-4"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method updates the list of gamepads to exclude any that are undefined.
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/c9664b66d360961284e7a99c19fda00faa7e6fab/src/inputs-controller.ts#L209">src/inputs-controller.ts:209</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"><h4class="tsd-anchor-link"><aid="Remarks-5"class="tsd-anchor"></a>Remarks<ahref="#Remarks-5"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></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>
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>