pokerogue/main/classes/inputs_controller.InputsCon...

139 lines
84 KiB
HTML
Raw Normal View History

2024-07-27 23:48:18 +00:00
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>InputsController | pokemon-rogue-battle</title><meta name="description" content="Documentation for pokemon-rogue-battle"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../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><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">pokemon-rogue-battle</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">pokemon-rogue-battle</a></li><li><a href="../modules/inputs_controller.html">inputs-controller</a></li><li><a href="inputs_controller.InputsController.html">InputsController</a></li></ul><h1>Class InputsController</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Manages and handles all input controls for the game, including keyboard and gamepad interactions.</p>
</div><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks" class="tsd-anchor"></a>Remarks<a href="#Remarks" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../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,
2024-05-31 13:57:14 +00:00
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
2024-07-27 23:48:18 +00:00
and responsive control handling throughout the game's lifecycle.</p>
2024-05-31 13:57:14 +00:00
<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>
2024-10-01 19:27:19 +00:00
</div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L76">src/inputs-controller.ts:76</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
2024-07-27 23:48:18 +00:00
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#events" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#gamepadSupport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>gamepad<wbr/>Support</span></a>
<a href="inputs_controller.InputsController.html#lastSource" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>last<wbr/>Source</span></a>
2024-08-17 17:01:18 +00:00
<a href="inputs_controller.InputsController.html#moveTouchControlsHandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#selectedDevice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>selected<wbr/>Device</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#assignBinding" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>assign<wbr/>Binding</span></a>
<a href="inputs_controller.InputsController.html#deactivatePressedKey" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>deactivate<wbr/>Pressed<wbr/>Key</span></a>
<a href="inputs_controller.InputsController.html#ensureKeyboardIsInit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span></a>
2024-05-31 13:57:14 +00:00
<a href="inputs_controller.InputsController.html#gamepadButtonDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>gamepad<wbr/>Button<wbr/>Down</span></a>
<a href="inputs_controller.InputsController.html#gamepadButtonUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>gamepad<wbr/>Button<wbr/>Up</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#getActiveConfig" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Active<wbr/>Config</span></a>
<a href="inputs_controller.InputsController.html#getConfig" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Config</span></a>
<a href="inputs_controller.InputsController.html#getConfigKeyboard" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Config<wbr/>Keyboard</span></a>
<a href="inputs_controller.InputsController.html#getGamepadsName" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Gamepads<wbr/>Name</span></a>
<a href="inputs_controller.InputsController.html#getIconForLatestInputRecorded" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Icon<wbr/>For<wbr/>Latest<wbr/>Input<wbr/>Recorded</span></a>
<a href="inputs_controller.InputsController.html#getLastSourceConfig" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Last<wbr/>Source<wbr/>Config</span></a>
<a href="inputs_controller.InputsController.html#getLastSourceDevice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Last<wbr/>Source<wbr/>Device</span></a>
<a href="inputs_controller.InputsController.html#getLastSourceType" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Last<wbr/>Source<wbr/>Type</span></a>
2024-05-31 13:57:14 +00:00
<a href="inputs_controller.InputsController.html#init" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#initChosenGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init<wbr/>Chosen<wbr/>Gamepad</span></a>
<a href="inputs_controller.InputsController.html#initChosenLayoutKeyboard" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span></a>
<a href="inputs_controller.InputsController.html#injectConfig" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inject<wbr/>Config</span></a>
<a href="inputs_controller.InputsController.html#keyboardKeyDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>keyboard<wbr/>Key<wbr/>Down</span></a>
<a href="inputs_controller.InputsController.html#keyboardKeyUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>keyboard<wbr/>Key<wbr/>Up</span></a>
2024-05-31 13:57:14 +00:00
<a href="inputs_controller.InputsController.html#loseFocus" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>lose<wbr/>Focus</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#onDisconnect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Disconnect</span></a>
<a href="inputs_controller.InputsController.html#onReconnect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Reconnect</span></a>
2024-05-31 13:57:14 +00:00
<a href="inputs_controller.InputsController.html#refreshGamepads" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>refresh<wbr/>Gamepads</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#resetConfigs" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reset<wbr/>Configs</span></a>
<a href="inputs_controller.InputsController.html#setChosenGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Chosen<wbr/>Gamepad</span></a>
<a href="inputs_controller.InputsController.html#setChosenKeyboardLayout" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span></a>
2024-05-31 13:57:14 +00:00
<a href="inputs_controller.InputsController.html#setGamepadSupport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Gamepad<wbr/>Support</span></a>
<a href="inputs_controller.InputsController.html#setupGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setup<wbr/>Gamepad</span></a>
2024-06-01 12:57:45 +00:00
<a href="inputs_controller.InputsController.html#setupKeyboard" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setup<wbr/>Keyboard</span></a>
2024-07-27 23:48:18 +00:00
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_InputsController" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Inputs<wbr/>Controller</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scene</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="inputs_controller.InputsController.html" class="tsd-signature-type tsd-kind-class">InputsController</a><a href="#constructor.new_InputsController" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes a new instance of the game control system, setting up initial state and configurations.</p>
2024-05-31 13:57:14 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">scene</span>: <a href="battle_scene.default.html" class="tsd-signature-type tsd-kind-class">default</a></span><div class="tsd-comment tsd-typography"><p>The Phaser scene associated with this instance.</p>
2024-07-27 23:48:18 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="inputs_controller.InputsController.html" class="tsd-signature-type tsd-kind-class">InputsController</a></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-1" class="tsd-anchor"></a>Remarks<a href="#Remarks-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This constructor initializes the game control system with necessary setups for handling inputs.
2024-05-31 13:57:14 +00:00
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>
2024-10-01 19:27:19 +00:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L108">src/inputs-controller.ts:108</a></li></ul></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="events" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>events</span><a href="#events" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">events</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EventEmitter</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L79">src/inputs-controller.ts:79</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="gamepadSupport" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Support</span><a href="#gamepadSupport" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">gamepad<wbr/>Support</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L85">src/inputs-controller.ts:85</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="lastSource" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>last<wbr/>Source</span><a href="#lastSource" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">last<wbr/>Source</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;keyboard&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L91">src/inputs-controller.ts:91</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="moveTouchControlsHandler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span><a href="#moveTouchControlsHandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span><span class="tsd-signature-symbol">:</span> <a href="ui_settings_move_touch_controls_handler.default.html" class="tsd-signature-type tsd-kind-class">default</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L94">src/inputs-controller.ts:94</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="selectedDevice" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>selected<wbr/>Device</span><a href="#selectedDevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">selected<wbr/>Device</span><span class="tsd-signature-symbol">:</sp
2024-06-01 12:57:45 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">config</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The configuration object.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">settingName</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The name of the setting to swap.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">pressedButton</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The button that was pressed.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L590">src/inputs-controller.ts:590</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="deactivatePressedKey" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>deactivate<wbr/>Pressed<wbr/>Key</span><a href="#deactivatePressedKey" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="deactivatePressedKey.deactivatePressedKey-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">deactivate<wbr/>Pressed<wbr/>Key</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#deactivatePressedKey.deactivatePressedKey-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Deactivates all currently pressed keys.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L513">src/inputs-controller.ts:513</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="ensureKeyboardIsInit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><a href="#ensureKeyboardIsInit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="ensureKeyboardIsInit.ensureKeyboardIsInit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#ensureKeyboardIsInit.ensureKeyboardIsInit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Ensures the keyboard is initialized by checking if there is an active configuration for the keyboard.
2024-06-01 12:57:45 +00:00
If not, it sets up the keyboard with default configurations.</p>
2024-10-01 19:27:19 +00:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L342">src/inputs-controller.ts:342</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="gamepadButtonDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Down</span><a href="#gamepadButtonDown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="gamepadButtonDown.gamepadButtonDown-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Down</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pad</span>, <span class="tsd-kind-parameter">button</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#gamepadButtonDown.gamepadButtonDown-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="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.
2024-06-01 12:57:45 +00:00
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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">pad</span>: <span class="tsd-signature-type">Gamepad</span></span><div class="tsd-comment tsd-typography"><p>The gamepad on which the button was pressed.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">button</span>: <span class="tsd-signature-type">Button</span></span><div class="tsd-comment tsd-typography"><p>The specific button that was pressed.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The intensity or value of the button press, if applicable.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L404">src/inputs-controller.ts:404</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="gamepadButtonUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Up</span><a href="#gamepadButtonUp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="gamepadButtonUp.gamepadButtonUp-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Up</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pad</span>, <span class="tsd-kind-parameter">button</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#gamepadButtonUp.gamepadButtonUp-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Responds to a button release event on a gamepad by checking if the gamepad is supported and currently chosen.
2024-06-01 12:57:45 +00:00
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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">pad</span>: <span class="tsd-signature-type">Gamepad</span></span><div class="tsd-comment tsd-typography"><p>The gamepad from which the button was released.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">button</span>: <span class="tsd-signature-type">Button</span></span><div class="tsd-comment tsd-typography"><p>The specific button that was released.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The intensity or value of the button release, if applicable.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L452">src/inputs-controller.ts:452</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getActiveConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Active<wbr/>Config</span><a href="#getActiveConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getActiveConfig.getActiveConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Active<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">device</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getActiveConfig.getActiveConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the active configuration for the currently chosen device.
2024-06-01 12:57:45 +00:00
It checks if a specific device ID is stored in configurations and returns it.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">device</span>: <a href="../enums/enums_devices.Device.html" class="tsd-signature-type tsd-kind-enum">Device</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><p>InterfaceConfig The configuration object for the active gamepad, or null if not set.</p>
2024-10-01 19:27:19 +00:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L526">src/inputs-controller.ts:526</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Config</span><a href="#getConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getConfig.getConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/inputs_controller.InterfaceConfig.html" class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><a href="#getConfig.getConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the configuration object for a gamepad based on its identifier. The method identifies specific gamepad models
2024-06-01 12:57:45 +00:00
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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The identifier string of the gamepad.</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../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>
2024-10-01 19:27:19 +00:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L480">src/inputs-controller.ts:480</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getConfigKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Config<wbr/>Keyboard</span><a href="#getConfigKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getConfigKeyboard.getConfigKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Config<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/inputs_controller.InterfaceConfig.html" class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><a href="#getConfigKeyboard.getConfigKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the configuration object for a keyboard layout based on its identifier.</p>
2024-06-01 12:57:45 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The identifier string of the keyboard layout.</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../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>
2024-10-01 19:27:19 +00:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L502">src/inputs-controller.ts:502</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getGamepadsName" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Gamepads<wbr/>Name</span><a href="#getGamepadsName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getGamepadsName.getGamepadsName-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Gamepads<wbr/>Name</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">String</span><span class="tsd-signature-symbol">[]</span><a href="#getGamepadsName.getGamepadsName-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the identifiers of all connected gamepads, excluding any that are currently marked as disconnected.</p>
2024-06-01 12:57:45 +00:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">String</span><span class="tsd-signature-symbol">[]</span></h4><p>Array<String> An array of strings representing the IDs of the connected gamepads.</p>
2024-10-01 19:27:19 +00:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L228">src/inputs-controller.ts:228</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getIconForLatestInputRecorded" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Icon<wbr/>For<wbr/>Latest<wbr/>Input<wbr/>Recorded</span><a href="#getIconForLatestInputRecorded" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getIconForLatestInputRecorded.getIconForLatestInputRecorded-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Icon<wbr/>For<wbr/>Latest<wbr/>Input<wbr/>Recorded</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">settingName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getIconForLatestInputRecorded.getIconForLatestInputRecorded-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">settingName</span>: <span class="tsd-signature-type">any</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L533">src/inputs-controller.ts:533</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getLastSourceConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Last<wbr/>Source<wbr/>Config</span><a href="#getLastSourceConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getLastSourceConfig.getLastSourceConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Last<wbr/>Source<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getLastSourceConfig.getLastSourceConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L548">src/inputs-controller.ts:548</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getLastSourceDevice" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Last<wbr/>Source<wbr/>Device</span><a href="#getLastSourceDevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getLastSourceDevice.getLastSourceDevice-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Last<wbr/>Source<wbr/>Device</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../enums/enums_devices.Device.html" class="tsd-signature-type tsd-kind-enum">Device</a><a href="#getLastSourceDevice.getLastSourceDevice-1" aria-label
2024-07-27 23:48:18 +00:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-2" class="tsd-anchor"></a>Remarks<a href="#Remarks-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method configures event listeners for both gamepad and keyboard inputs.
2024-05-31 13:57:14 +00:00
It handles gamepad connections/disconnections and button press events, and ensures keyboard controls are set up.
2024-07-27 23:48:18 +00:00
Additionally, it manages the game's behavior when it loses focus to prevent unwanted game actions during this state.</p>
2024-10-01 19:27:19 +00:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L136">src/inputs-controller.ts:136</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="initChosenGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Gamepad</span><a href="#initChosenGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="initChosenGamepad.initChosenGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">gamepadName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#initChosenGamepad.initChosenGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="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.
2024-06-01 12:57:45 +00:00
If a gamepad name is provided, it uses that as the chosen gamepad; otherwise, it defaults to the currently chosen gamepad.</p>
2024-07-27 23:48:18 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">gamepadName</span>: <span class="tsd-signature-type">String</span></span><div class="tsd-comment tsd-typography"><p>Optional parameter to specify the name of the gamepad to initialize as chosen.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L237">src/inputs-controller.ts:237</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="initChosenLayoutKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><a href="#initChosenLayoutKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="initChosenLayoutKeyboard.initChosenLayoutKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">layoutKeyboard</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#initChosenLayoutKeyboard.initChosenLayoutKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="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.
2024-06-01 12:57:45 +00:00
If a layout name is provided, it uses that as the chosen layout; otherwise, it defaults to the currently chosen layout.</p>
2024-07-27 23:48:18 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">layoutKeyboard</span>: <span class="tsd-signature-type">String</span></span><div class="tsd-comment tsd-typography"><p>Optional parameter to specify the name of the keyboard layout to initialize as chosen.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L250">src/inputs-controller.ts:250</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="injectConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>inject<wbr/>Config</span><a href="#injectConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="injectConfig.injectConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">inject<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">selectedDevice</span>, <span class="tsd-kind-parameter">mappingConfigs</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#injectConfig.injectConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Injects a custom mapping configuration into the configuration for a specific gamepad.
2024-06-01 12:57:45 +00:00
If the device does not have an existing configuration, it initializes one first.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">selectedDevice</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The identifier of the device to configure.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">mappingConfigs</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The mapping configuration to apply to the device.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L568">src/inputs-controller.ts:568</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="keyboardKeyDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>keyboard<wbr/>Key<wbr/>Down</span><a href="#keyboardKeyDown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="keyboardKeyDown.keyboardKeyDown-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">keyboard<wbr/>Key<wbr/>Down</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#keyboardKeyDown.keyboardKeyDown-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the keydown event for the keyboard.</p>
2024-06-01 12:57:45 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The keyboard event.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L353">src/inputs-controller.ts:353</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="keyboardKeyUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>keyboard<wbr/>Key<wbr/>Up</span><a href="#keyboardKeyUp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="keyboardKeyUp.keyboardKeyUp-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">keyboard<wbr/>Key<wbr/>Up</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#keyboardKeyUp.keyboardKeyUp-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the keyup event for the keyboard.</p>
2024-06-01 12:57:45 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The keyboard event.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L381">src/inputs-controller.ts:381</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="loseFocus" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>lose<wbr/>Focus</span><a href="#loseFocus" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="loseFocus.loseFocus-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">lose<wbr/>Focus</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#loseFocus.loseFocus-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles actions to take when the game loses focus, such as deactivating pressed keys.</p>
2024-07-27 23:48:18 +00:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-3" class="tsd-anchor"></a>Remarks<a href="#Remarks-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../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>
2024-10-01 19:27:19 +00:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L181">src/inputs-controller.ts:181</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="onDisconnect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Disconnect</span><a href="#onDisconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="onDisconnect.onDisconnect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on<wbr/>Disconnect</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#onDisconnect.onDisconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the disconnection of a gamepad by adding its identifier to a list of disconnected gamepads.
2024-06-01 12:57:45 +00:00
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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">thisGamepad</span>: <span class="tsd-signature-type">Gamepad</span></span><div class="tsd-comment tsd-typography"><p>The gamepad that has been disconnected.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L266">src/inputs-controller.ts:266</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="onReconnect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Reconnect</span><a href="#onReconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="onReconnect.onReconnect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on<wbr/>Reconnect</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#onReconnect.onReconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates the tracking of disconnected gamepads when a gamepad is reconnected.
2024-07-27 23:48:18 +00:00
It removes the reconnected gamepad's identifier from the <code>disconnectedGamepads</code> array,
2024-06-01 12:57:45 +00:00
effectively updating its status to connected.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">thisGamepad</span>: <span class="tsd-signature-type">Gamepad</span></span><div class="tsd-comment tsd-typography"><p>The gamepad that has been reconnected.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L277">src/inputs-controller.ts:277</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="refreshGamepads" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>refresh<wbr/>Gamepads</span><a href="#refreshGamepads" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="refreshGamepads.refreshGamepads-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">refresh<wbr/>Gamepads</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#refreshGamepads.refreshGamepads-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Refreshes and re-indexes the list of connected gamepads.</p>
2024-07-27 23:48:18 +00:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-4" class="tsd-anchor"></a>Remarks<a href="#Remarks-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method updates the list of gamepads to exclude any that are undefined.
2024-05-31 13:57:14 +00:00
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>
2024-10-01 19:27:19 +00:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L327">src/inputs-controller.ts:327</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="resetConfigs" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>reset<wbr/>Configs</span><a href="#resetConfigs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="resetConfigs.resetConfigs-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">reset<wbr/>Configs</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#resetConfigs.resetConfigs-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L575">src/inputs-controller.ts:575</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setChosenGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Gamepad</span><a href="#setChosenGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setChosenGamepad.setChosenGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">gamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setChosenGamepad.setChosenGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the currently chosen gamepad and initializes related settings.
2024-06-01 12:57:45 +00:00
This method first deactivates any active key presses and then initializes the gamepad settings.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">gamepad</span>: <span class="tsd-signature-type">String</span></span><div class="tsd-comment tsd-typography"><p>The identifier of the gamepad to set as chosen.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L209">src/inputs-controller.ts:209</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setChosenKeyboardLayout" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><a href="#setChosenKeyboardLayout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setChosenKeyboardLayout.setChosenKeyboardLayout-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">layoutKeyboard</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setChosenKeyboardLayout.setChosenKeyboardLayout-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the currently chosen keyboard layout and initializes related settings.</p>
2024-06-01 12:57:45 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">layoutKeyboard</span>: <span class="tsd-signature-type">String</span></span><div class="tsd-comment tsd-typography"><p>The identifier of the keyboard layout to set as chosen.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L219">src/inputs-controller.ts:219</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setGamepadSupport" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Gamepad<wbr/>Support</span><a href="#setGamepadSupport" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setGamepadSupport.setGamepadSupport-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Gamepad<wbr/>Support</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setGamepadSupport.setGamepadSupport-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Enables or disables support for gamepad input.</p>
2024-05-31 13:57:14 +00:00
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>A boolean indicating whether gamepad support should be enabled (true) or disabled (false).</p>
2024-07-27 23:48:18 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-5" class="tsd-anchor"></a>Remarks<a href="#Remarks-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../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>
2024-10-01 19:27:19 +00:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L194">src/inputs-controller.ts:194</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setupGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>setup<wbr/>Gamepad</span><a href="#setupGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setupGamepad.setupGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setup<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setupGamepad.setupGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes or updates configurations for connected gamepads.
2024-06-01 12:57:45 +00:00
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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">thisGamepad</span>: <span class="tsd-signature-type">Gamepad</span></span><div class="tsd-comment tsd-typography"><p>The gamepad that is being set up.</p>
2024-10-01 19:27:19 +00:00
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L289">src/inputs-controller.ts:289</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setupKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>setup<wbr/>Keyboard</span><a href="#setupKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setupKeyboard.setupKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setup<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setupKeyboard.setupKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes or updates configurations for connected keyboards.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/160b730921d8d58b925ae0c2c5d353d5ee3b4505/src/inputs-controller.ts#L309">src/inputs-controller.ts:309</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#events" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a><a href="#gamepadSupport" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>gamepad<wbr/>Support</span></a><a href="#lastSource" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><