pokerogue/main/classes/inputs_controller.InputsController.html

213 lines
111 KiB
HTML
Raw Normal View History

2024-05-31 14:57:14 +01: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>Remarks</h4><p>This class is designed to centralize input management across the game. It facilitates the setup,
configuration, and handling of all game inputs, making it easier to manage various input devices
such as keyboards and gamepads. The class provides methods for setting up input devices, handling
their events, and responding to changes in input state (e.g., button presses, releases).</p>
<p>The <code>InputsController</code> class also includes mechanisms to handle game focus events to ensure input
states are correctly reset and managed when the game loses or regains focus, maintaining robust
and responsive control handling throughout the game&#39;s lifecycle.</p>
<p>Key responsibilities include:</p>
<ul>
<li>Initializing and configuring gamepad and keyboard controls.</li>
<li>Emitting events related to specific input actions.</li>
<li>Responding to external changes such as gamepad connection/disconnection.</li>
<li>Managing game state transitions in response to input events, particularly focus loss and recovery.</li>
</ul>
<p>Usage of this class is intended to simplify input management across various parts of the game,
providing a unified interface for all input-related interactions.</p>
2024-06-08 14:52:38 +01:00
</div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L90">src/inputs-controller.ts:90</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-index-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-06-06 21:56:09 +01: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#buttonLock" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>button<wbr/>Lock</span></a>
2024-06-01 13:57:45 +01:00
<a href="inputs_controller.InputsController.html#configs" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>configs</span></a>
<a href="inputs_controller.InputsController.html#disconnectedGamepads" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>disconnected<wbr/>Gamepads</span></a>
2024-05-31 14:57:14 +01:00
<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 13:57:45 +01: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>
2024-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#gamepads" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>gamepads</span></a>
<a href="inputs_controller.InputsController.html#interactions" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>interactions</span></a>
2024-06-01 13:57:45 +01:00
<a href="inputs_controller.InputsController.html#keys" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>keys</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>
<a href="inputs_controller.InputsController.html#pauseUpdate" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pause<wbr/>Update</span></a>
2024-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#scene" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>scene</span></a>
2024-06-01 13:57:45 +01: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>
2024-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#delLastProcessedMovementTime" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>del<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span></a>
2024-06-01 13:57:45 +01:00
<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 14:57:14 +01: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 13:57:45 +01: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 14:57:14 +01: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 13:57:45 +01: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>
2024-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#isButtonLocked" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Button<wbr/>Locked</span></a>
2024-06-01 13:57:45 +01:00
<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 14:57:14 +01: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 13:57:45 +01: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 14:57:14 +01: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>
<a href="inputs_controller.InputsController.html#releaseButtonLock" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>release<wbr/>Button<wbr/>Lock</span></a>
<a href="inputs_controller.InputsController.html#repeatInputDurationJustPassed" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>repeat<wbr/>Input<wbr/>Duration<wbr/>Just<wbr/>Passed</span></a>
2024-06-01 13:57:45 +01: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>
2024-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#setButtonLock" 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/>Button<wbr/>Lock</span></a>
2024-06-01 13:57:45 +01:00
<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 14:57:14 +01: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#setLastProcessedMovementTime" 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/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</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 13:57:45 +01: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-05-31 14:57:14 +01:00
<a href="inputs_controller.InputsController.html#update" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a>
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><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>
</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>
</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>Remarks</h4><p>This constructor initializes the game control system with necessary setups for handling inputs.
It prepares an interactions array indexed by button identifiers and configures default states for each button.
Specific buttons like MENU and STATS are set not to repeat their actions.
It concludes by calling the <code>init</code> method to complete the setup.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L121">src/inputs-controller.ts:121</a></li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-private"><a id="buttonLock" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>button<wbr/>Lock</span><a href="#buttonLock" 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">button<wbr/>Lock</span><span class="tsd-signature-symbol">:</span> <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L95">src/inputs-controller.ts:95</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="configs" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>configs</span><a href="#configs" 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">configs</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/inputs_controller.InterfaceConfig.html" class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L97">src/inputs-controller.ts:97</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="disconnectedGamepads" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>disconnected<wbr/>Gamepads</span><a href="#disconnectedGamepads" 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">disconnected<wbr/>Gamepads</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">String</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L102">src/inputs-controller.ts:102</a></li></ul></aside></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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L93">src/inputs-controller.ts:93</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
2024-06-01 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L753">src/inputs-controller.ts:753</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 and resets their interaction states.</p>
2024-05-31 14:57:14 +01:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is used to reset the state of all buttons within the <code>interactions</code> dictionary,
effectively deactivating any currently pressed keys. It performs the following actions:</p>
<ul>
2024-06-01 13:57:45 +01:00
<li>Releases button lock for predefined buttons, allowing them
2024-05-31 14:57:14 +01:00
to be pressed again or properly re-initialized in future interactions.</li>
<li>Iterates over all possible button values obtained via <code>Utils.getEnumValues(Button)</code>, and for
each button:<ul>
<li>Checks if the button is currently registered in the <code>interactions</code> dictionary.</li>
<li>Resets <code>pressTime</code> to null, indicating that there is no ongoing interaction.</li>
<li>Sets <code>isPressed</code> to false, marking the button as not currently active.</li>
<li>Clears the <code>source</code> field, removing the record of which device the button press came from.</li>
</ul>
</li>
</ul>
<p>This method is typically called when needing to ensure that all inputs are neutralized.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L626">src/inputs-controller.ts:626</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="delLastProcessedMovementTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>del<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><a href="#delLastProcessedMovementTime" 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="delLastProcessedMovementTime.delLastProcessedMovementTime-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">del<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#delLastProcessedMovementTime.delLastProcessedMovementTime-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>Clears the last interaction for a specified button.</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>The button for which to clear the interaction.</p>
</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>Remarks</h4><p>This method resets the interaction details of the button, allowing it to be processed as a new input when pressed again.
If the button is not registered in the <code>interactions</code> dictionary, this method returns immediately, otherwise:</p>
<ul>
<li><code>pressTime</code> is cleared. This was previously storing the timestamp of when the button was initially pressed.</li>
<li><code>isPressed</code> is set to false, indicating that the button is no longer being pressed.</li>
<li><code>source</code> is set to null, which had been indicating the device from which the button input was originating.</li>
</ul>
<p>It releases the button lock, which prevents the button from being processed repeatedly until it&#39;s explicitly released.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L597">src/inputs-controller.ts:597</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 13:57:45 +01:00
If not, it sets up the keyboard with default configurations.</p>
2024-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L394">src/inputs-controller.ts:394</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/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="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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L486">src/inputs-controller.ts:486</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 13:57:45 +01: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-06-08 14:52:38 +01:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L689">src/inputs-controller.ts:689</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 13:57:45 +01: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-06-08 14:52:38 +01:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L512">src/inputs-controller.ts:512</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 13:57:45 +01: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-06-08 14:52:38 +01:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L534">src/inputs-controller.ts:534</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 13:57:45 +01: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-06-08 14:52:38 +01:00
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L280">src/inputs-controller.ts:280</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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L696">src/inputs-controller.ts:696</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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L711">src/inputs-controller.ts:711</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-05-31 14:57:14 +01:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method configures event listeners for both gamepad and keyboard inputs.
It handles gamepad connections/disconnections and button press events, and ensures keyboard controls are set up.
Additionally, it manages the game&#39;s behavior when it loses focus to prevent unwanted game actions during this state.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L149">src/inputs-controller.ts:149</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 13:57:45 +01:00
If a gamepad name is provided, it uses that as the chosen gamepad; otherwise, it defaults to the currently chosen gamepad.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/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="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 13:57:45 +01:00
If a layout name is provided, it uses that as the chosen layout; otherwise, it defaults to the currently chosen layout.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L302">src/inputs-controller.ts:302</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L731">src/inputs-controller.ts:731</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="isButtonLocked" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Button<wbr/>Locked</span><a href="#isButtonLocked" 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="isButtonLocked.isButtonLocked-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Button<wbr/>Locked</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isButtonLocked.isButtonLocked-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>Checks if a specific button is currently locked.</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>The button to check for a lock status.</p>
2024-06-01 13:57:45 +01: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><p><code>true</code> if the button is locked, otherwise <code>false</code>.</p>
2024-05-31 14:57:14 +01:00
<div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is used to determine if a given button is currently prevented from being processed due to a lock.
It checks against two separate lock variables, allowing for up to two buttons to be locked simultaneously.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L650">src/inputs-controller.ts:650</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L405">src/inputs-controller.ts:405</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L428">src/inputs-controller.ts:428</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-05-31 14:57:14 +01:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is triggered when the game or the browser tab loses focus. It ensures that any keys pressed are deactivated to prevent stuck keys affecting gameplay when the game is not active.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L193">src/inputs-controller.ts:193</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L318">src/inputs-controller.ts:318</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-06-01 13:57:45 +01:00
It removes the reconnected gamepad&#39;s identifier from the <code>disconnectedGamepads</code> array,
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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L329">src/inputs-controller.ts:329</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-05-31 14:57:14 +01:00
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method updates the list of gamepads to exclude any that are undefined.
It corrects the index of each gamepad to account for any previously undefined entries,
ensuring that all gamepads are properly indexed and can be accurately referenced within the game.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L379">src/inputs-controller.ts:379</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="releaseButtonLock" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>release<wbr/>Button<wbr/>Lock</span><a href="#releaseButtonLock" 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="releaseButtonLock.releaseButtonLock-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">release<wbr/>Button<wbr/>Lock</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#releaseButtonLock.releaseButtonLock-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>Releases a lock on a specific button, allowing it to be processed again.</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>The button whose lock is to be released.</p>
2024-06-01 13:57:45 +01: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>Remarks</h4><p>This method checks lock variable.
2024-05-31 14:57:14 +01:00
If either lock matches the specified button, that lock is cleared.
This action frees the button to be processed again, ensuring it can respond to new inputs.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L677">src/inputs-controller.ts:677</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="repeatInputDurationJustPassed" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>repeat<wbr/>Input<wbr/>Duration<wbr/>Just<wbr/>Passed</span><a href="#repeatInputDurationJustPassed" 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="repeatInputDurationJustPassed.repeatInputDurationJustPassed-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">repeat<wbr/>Input<wbr/>Duration<wbr/>Just<wbr/>Passed</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#repeatInputDurationJustPassed.repeatInputDurationJustPassed-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>repeatInputDurationJustPassed returns true if</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>has been held down long
enough to fire a repeated input. A button must claim the buttonLock before
firing a repeated input - this is to prevent multiple buttons from firing repeatedly.</p>
2024-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L547">src/inputs-controller.ts:547</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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L738">src/inputs-controller.ts:738</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setButtonLock" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Button<wbr/>Lock</span><a href="#setButtonLock" 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="setButtonLock.setButtonLock-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Button<wbr/>Lock</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setButtonLock.setButtonLock-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 a lock on a given button.</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>The button to lock.</p>
</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>Remarks</h4><p>This method ensures that a button is not processed multiple times inadvertently.
2024-06-01 13:57:45 +01:00
It checks if the button is already locked.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L663">src/inputs-controller.ts:663</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L220">src/inputs-controller.ts:220</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L230">src/inputs-controller.ts:230</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 14:57:14 +01: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>
</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>Remarks</h4><p>This method toggles gamepad support. If disabled, it also ensures that all currently pressed gamepad buttons are deactivated to avoid stuck inputs.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L205">src/inputs-controller.ts:205</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setLastProcessedMovementTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><a href="#setLastProcessedMovementTime" 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="setLastProcessedMovementTime.setLastProcessedMovementTime-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Last<wbr/>Processed<wbr/>Movement<wbr/>Time</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">button</span>, <span class="tsd-kind-parameter">source</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">sourceName</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="#setLastProcessedMovementTime.setLastProcessedMovementTime-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>This method updates the interaction state to reflect that the button is pressed.</p>
2024-05-31 14:57:14 +01: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">button</span>: <a href="../enums/enums_buttons.Button.html" class="tsd-signature-type tsd-kind-enum">Button</a></span><div class="tsd-comment tsd-typography"><p>The button for which to set the interaction.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">source</span>: <span class="tsd-signature-type">String</span><span class="tsd-signature-symbol"> = &quot;keyboard&quot;</span></span><div class="tsd-comment tsd-typography"><p>The source of the input (defaults to &#39;keyboard&#39;). This helps identify the origin of the input, especially useful in environments with multiple input devices.</p>
2024-06-01 13:57:45 +01:00
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">sourceName</span>: <span class="tsd-signature-type">String</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Remarks</h4><p>This method is responsible for updating the interaction state of a button within the <code>interactions</code> dictionary. If the button is not already registered, this method returns immediately.
2024-05-31 14:57:14 +01:00
When invoked, it performs the following updates:</p>
<ul>
<li><code>pressTime</code>: Sets this to the current time, representing when the button was initially pressed.</li>
<li><code>isPressed</code>: Marks the button as currently being pressed.</li>
<li><code>source</code>: Identifies the source device of the input, which can vary across different hardware (e.g., keyboard, gamepad).</li>
</ul>
<p>Additionally, this method locks the button (by calling <code>setButtonLock</code>) to prevent it from being re-processed until it is released, ensuring that each press is handled distinctly.</p>
2024-06-08 14:52:38 +01:00
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L572">src/inputs-controller.ts:572</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 13:57:45 +01: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-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L341">src/inputs-controller.ts:341</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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L361">src/inputs-controller.ts:361</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="update" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>update</span><a href="#update" 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="update.update-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">update</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="#update.update-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 interaction handling by processing input states.
2024-06-01 13:57:45 +01:00
This method gives priority to certain buttons by reversing the order in which they are checked.
This method loops through all button values, checks for valid and timely interactions, and conditionally processes
or ignores them based on the current state of gamepad support and other criteria.</p>
<p>It handles special conditions such as the absence of gamepad support or mismatches between the source of the input and
the currently chosen gamepad. It also respects the paused state of updates to prevent unwanted input processing.</p>
<p>If an interaction is valid and should be processed, it emits an &#39;input_down&#39; event with details of the interaction.</p>
2024-06-08 14:52:38 +01: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/bd5d16802a1cb644a9cc9fb040a5c9021e07fb98/src/inputs-controller.ts#L246">src/inputs-controller.ts:246</a></li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-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"><h4 class="uppercase">Member Visibility</h4><form><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-private" name="private"/><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>Private</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></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><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-index-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"><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><a href="#buttonLock" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>button<wbr/>Lock</span></a><a href="#configs" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>configs</span></a><a href="#disconnectedGamepads" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>disconnected<wbr/>Gamepads</span></a><a href="#events" cla