139 lines
84 KiB
HTML
139 lines
84 KiB
HTML
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>InputsController | pokemon-rogue-battle</title><meta name="description" content="Documentation for pokemon-rogue-battle"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">pokemon-rogue-battle</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">pokemon-rogue-battle</a></li><li><a href="../modules/inputs_controller.html">inputs-controller</a></li><li><a href="inputs_controller.InputsController.html">InputsController</a></li></ul><h1>Class InputsController</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Manages and handles all input controls for the game, including keyboard and gamepad interactions.</p>
|
|
</div><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks" class="tsd-anchor"></a>Remarks<a href="#Remarks" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This class is designed to centralize input management across the game. It facilitates the setup,
|
|
configuration, and handling of all game inputs, making it easier to manage various input devices
|
|
such as keyboards and gamepads. The class provides methods for setting up input devices, handling
|
|
their events, and responding to changes in input state (e.g., button presses, releases).</p>
|
|
<p>The <code>InputsController</code> class also includes mechanisms to handle game focus events to ensure input
|
|
states are correctly reset and managed when the game loses or regains focus, maintaining robust
|
|
and responsive control handling throughout the game's lifecycle.</p>
|
|
<p>Key responsibilities include:</p>
|
|
<ul>
|
|
<li>Initializing and configuring gamepad and keyboard controls.</li>
|
|
<li>Emitting events related to specific input actions.</li>
|
|
<li>Responding to external changes such as gamepad connection/disconnection.</li>
|
|
<li>Managing game state transitions in response to input events, particularly focus loss and recovery.</li>
|
|
</ul>
|
|
<p>Usage of this class is intended to simplify input management across various parts of the game,
|
|
providing a unified interface for all input-related interactions.</p>
|
|
</div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L76">src/inputs-controller.ts:76</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#events" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a>
|
|
<a href="inputs_controller.InputsController.html#gamepadSupport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>gamepad<wbr/>Support</span></a>
|
|
<a href="inputs_controller.InputsController.html#lastSource" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>last<wbr/>Source</span></a>
|
|
<a href="inputs_controller.InputsController.html#moveTouchControlsHandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span></a>
|
|
<a href="inputs_controller.InputsController.html#selectedDevice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>selected<wbr/>Device</span></a>
|
|
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="inputs_controller.InputsController.html#assignBinding" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>assign<wbr/>Binding</span></a>
|
|
<a href="inputs_controller.InputsController.html#deactivatePressedKey" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>deactivate<wbr/>Pressed<wbr/>Key</span></a>
|
|
<a href="inputs_controller.InputsController.html#ensureKeyboardIsInit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span></a>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<a href="inputs_controller.InputsController.html#initChosenGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init<wbr/>Chosen<wbr/>Gamepad</span></a>
|
|
<a href="inputs_controller.InputsController.html#initChosenLayoutKeyboard" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span></a>
|
|
<a href="inputs_controller.InputsController.html#injectConfig" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inject<wbr/>Config</span></a>
|
|
<a href="inputs_controller.InputsController.html#keyboardKeyDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>keyboard<wbr/>Key<wbr/>Down</span></a>
|
|
<a href="inputs_controller.InputsController.html#keyboardKeyUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>keyboard<wbr/>Key<wbr/>Up</span></a>
|
|
<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>
|
|
<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>
|
|
<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#resetConfigs" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reset<wbr/>Configs</span></a>
|
|
<a href="inputs_controller.InputsController.html#setChosenGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Chosen<wbr/>Gamepad</span></a>
|
|
<a href="inputs_controller.InputsController.html#setChosenKeyboardLayout" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span></a>
|
|
<a href="inputs_controller.InputsController.html#setGamepadSupport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Gamepad<wbr/>Support</span></a>
|
|
<a href="inputs_controller.InputsController.html#setupGamepad" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setup<wbr/>Gamepad</span></a>
|
|
<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>
|
|
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_InputsController" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Inputs<wbr/>Controller</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scene</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="inputs_controller.InputsController.html" class="tsd-signature-type tsd-kind-class">InputsController</a><a href="#constructor.new_InputsController" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes a new instance of the game control system, setting up initial state and configurations.</p>
|
|
</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 class="tsd-anchor-link"><a id="Remarks-1" class="tsd-anchor"></a>Remarks<a href="#Remarks-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This constructor initializes the game control system with necessary setups for handling inputs.
|
|
It prepares an interactions array indexed by button identifiers and configures default states for each button.
|
|
Specific buttons like MENU and STATS are set not to repeat their actions.
|
|
It concludes by calling the <code>init</code> method to complete the setup.</p>
|
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L108">src/inputs-controller.ts:108</a></li></ul></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="events" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>events</span><a href="#events" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">events</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EventEmitter</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L79">src/inputs-controller.ts:79</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="gamepadSupport" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Support</span><a href="#gamepadSupport" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">gamepad<wbr/>Support</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L85">src/inputs-controller.ts:85</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="lastSource" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>last<wbr/>Source</span><a href="#lastSource" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">last<wbr/>Source</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "keyboard"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L91">src/inputs-controller.ts:91</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="moveTouchControlsHandler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span><a href="#moveTouchControlsHandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span><span class="tsd-signature-symbol">:</span> <a href="ui_settings_move_touch_controls_handler.default.html" class="tsd-signature-type tsd-kind-class">default</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L94">src/inputs-controller.ts:94</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="selectedDevice" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>selected<wbr/>Device</span><a href="#selectedDevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">selected<wbr/>Device</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L86">src/inputs-controller.ts:86</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="assignBinding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>assign<wbr/>Binding</span><a href="#assignBinding" 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="assignBinding.assignBinding-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">assign<wbr/>Binding</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">config</span>, <span class="tsd-kind-parameter">settingName</span>, <span class="tsd-kind-parameter">pressedButton</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#assignBinding.assignBinding-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>Swaps a binding in the 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">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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L590">src/inputs-controller.ts:590</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="deactivatePressedKey" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>deactivate<wbr/>Pressed<wbr/>Key</span><a href="#deactivatePressedKey" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="deactivatePressedKey.deactivatePressedKey-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">deactivate<wbr/>Pressed<wbr/>Key</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#deactivatePressedKey.deactivatePressedKey-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Deactivates all currently pressed keys.</p>
|
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L513">src/inputs-controller.ts:513</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="ensureKeyboardIsInit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><a href="#ensureKeyboardIsInit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="ensureKeyboardIsInit.ensureKeyboardIsInit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">ensure<wbr/>Keyboard<wbr/>Is<wbr/>Init</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#ensureKeyboardIsInit.ensureKeyboardIsInit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Ensures the keyboard is initialized by checking if there is an active configuration for the keyboard.
|
|
If not, it sets up the keyboard with default configurations.</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L342">src/inputs-controller.ts:342</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="gamepadButtonDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Down</span><a href="#gamepadButtonDown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="gamepadButtonDown.gamepadButtonDown-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Down</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pad</span>, <span class="tsd-kind-parameter">button</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#gamepadButtonDown.gamepadButtonDown-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles button press events on a gamepad. This method sets the gamepad as chosen on the first input if no gamepad is currently chosen.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L404">src/inputs-controller.ts:404</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="gamepadButtonUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>gamepad<wbr/>Button<wbr/>Up</span><a href="#gamepadButtonUp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="gamepadButtonUp.gamepadButtonUp-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">gamepad<wbr/>Button<wbr/>Up</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pad</span>, <span class="tsd-kind-parameter">button</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#gamepadButtonUp.gamepadButtonUp-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Responds to a button release event on a gamepad by checking if the gamepad is supported and currently chosen.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L452">src/inputs-controller.ts:452</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getActiveConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Active<wbr/>Config</span><a href="#getActiveConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getActiveConfig.getActiveConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Active<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">device</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getActiveConfig.getActiveConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the active configuration for the currently chosen device.
|
|
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>
|
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L526">src/inputs-controller.ts:526</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Config</span><a href="#getConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getConfig.getConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/inputs_controller.InterfaceConfig.html" class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><a href="#getConfig.getConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the configuration object for a gamepad based on its identifier. The method identifies specific gamepad models
|
|
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>
|
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L480">src/inputs-controller.ts:480</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getConfigKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Config<wbr/>Keyboard</span><a href="#getConfigKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getConfigKeyboard.getConfigKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Config<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/inputs_controller.InterfaceConfig.html" class="tsd-signature-type tsd-kind-interface">InterfaceConfig</a><a href="#getConfigKeyboard.getConfigKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the configuration object for a keyboard layout based on its identifier.</p>
|
|
</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>
|
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L502">src/inputs-controller.ts:502</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getGamepadsName" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Gamepads<wbr/>Name</span><a href="#getGamepadsName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getGamepadsName.getGamepadsName-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Gamepads<wbr/>Name</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">String</span><span class="tsd-signature-symbol">[]</span><a href="#getGamepadsName.getGamepadsName-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the identifiers of all connected gamepads, excluding any that are currently marked as disconnected.</p>
|
|
</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>
|
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L228">src/inputs-controller.ts:228</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getIconForLatestInputRecorded" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Icon<wbr/>For<wbr/>Latest<wbr/>Input<wbr/>Recorded</span><a href="#getIconForLatestInputRecorded" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getIconForLatestInputRecorded.getIconForLatestInputRecorded-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Icon<wbr/>For<wbr/>Latest<wbr/>Input<wbr/>Recorded</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">settingName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getIconForLatestInputRecorded.getIconForLatestInputRecorded-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">settingName</span>: <span class="tsd-signature-type">any</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L533">src/inputs-controller.ts:533</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getLastSourceConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Last<wbr/>Source<wbr/>Config</span><a href="#getLastSourceConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getLastSourceConfig.getLastSourceConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Last<wbr/>Source<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#getLastSourceConfig.getLastSourceConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L548">src/inputs-controller.ts:548</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getLastSourceDevice" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Last<wbr/>Source<wbr/>Device</span><a href="#getLastSourceDevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getLastSourceDevice.getLastSourceDevice-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Last<wbr/>Source<wbr/>Device</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../enums/enums_devices.Device.html" class="tsd-signature-type tsd-kind-enum">Device</a><a href="#getLastSourceDevice.getLastSourceDevice-1" aria-label="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 <a href="../enums/enums_devices.Device.html" class="tsd-signature-type tsd-kind-enum">Device</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L540">src/inputs-controller.ts:540</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getLastSourceType" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Last<wbr/>Source<wbr/>Type</span><a href="#getLastSourceType" 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="getLastSourceType.getLastSourceType-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Last<wbr/>Source<wbr/>Type</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="#getLastSourceType.getLastSourceType-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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L556">src/inputs-controller.ts:556</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="init" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>init</span><a href="#init" 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="init.init-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">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="#init.init-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 up event handlers and initializes gamepad and keyboard controls.</p>
|
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-2" class="tsd-anchor"></a>Remarks<a href="#Remarks-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method configures event listeners for both gamepad and keyboard inputs.
|
|
It handles gamepad connections/disconnections and button press events, and ensures keyboard controls are set up.
|
|
Additionally, it manages the game's behavior when it loses focus to prevent unwanted game actions during this state.</p>
|
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L136">src/inputs-controller.ts:136</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="initChosenGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Gamepad</span><a href="#initChosenGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="initChosenGamepad.initChosenGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">gamepadName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#initChosenGamepad.initChosenGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the chosen gamepad by setting its identifier in the local storage and updating the UI to reflect the chosen gamepad.
|
|
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">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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L237">src/inputs-controller.ts:237</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="initChosenLayoutKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><a href="#initChosenLayoutKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="initChosenLayoutKeyboard.initChosenLayoutKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">init<wbr/>Chosen<wbr/>Layout<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">layoutKeyboard</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#initChosenLayoutKeyboard.initChosenLayoutKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the chosen keyboard layout by setting its identifier in the local storage and updating the UI to reflect the chosen layout.
|
|
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">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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L250">src/inputs-controller.ts:250</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="injectConfig" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>inject<wbr/>Config</span><a href="#injectConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="injectConfig.injectConfig-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">inject<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">selectedDevice</span>, <span class="tsd-kind-parameter">mappingConfigs</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#injectConfig.injectConfig-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Injects a custom mapping configuration into the configuration for a specific gamepad.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L568">src/inputs-controller.ts:568</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="keyboardKeyDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>keyboard<wbr/>Key<wbr/>Down</span><a href="#keyboardKeyDown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="keyboardKeyDown.keyboardKeyDown-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">keyboard<wbr/>Key<wbr/>Down</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#keyboardKeyDown.keyboardKeyDown-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the keydown event for the keyboard.</p>
|
|
</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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L353">src/inputs-controller.ts:353</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="keyboardKeyUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>keyboard<wbr/>Key<wbr/>Up</span><a href="#keyboardKeyUp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="keyboardKeyUp.keyboardKeyUp-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">keyboard<wbr/>Key<wbr/>Up</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#keyboardKeyUp.keyboardKeyUp-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the keyup event for the keyboard.</p>
|
|
</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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L381">src/inputs-controller.ts:381</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="loseFocus" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>lose<wbr/>Focus</span><a href="#loseFocus" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="loseFocus.loseFocus-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">lose<wbr/>Focus</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#loseFocus.loseFocus-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles actions to take when the game loses focus, such as deactivating pressed keys.</p>
|
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-3" class="tsd-anchor"></a>Remarks<a href="#Remarks-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method is triggered when the game or the browser tab loses focus. It ensures that any keys pressed are deactivated to prevent stuck keys affecting gameplay when the game is not active.</p>
|
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L181">src/inputs-controller.ts:181</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="onDisconnect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Disconnect</span><a href="#onDisconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="onDisconnect.onDisconnect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on<wbr/>Disconnect</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#onDisconnect.onDisconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handles the disconnection of a gamepad by adding its identifier to a list of disconnected gamepads.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L266">src/inputs-controller.ts:266</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="onReconnect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Reconnect</span><a href="#onReconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="onReconnect.onReconnect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on<wbr/>Reconnect</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#onReconnect.onReconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates the tracking of disconnected gamepads when a gamepad is reconnected.
|
|
It removes the reconnected gamepad'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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L277">src/inputs-controller.ts:277</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="refreshGamepads" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>refresh<wbr/>Gamepads</span><a href="#refreshGamepads" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="refreshGamepads.refreshGamepads-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">refresh<wbr/>Gamepads</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#refreshGamepads.refreshGamepads-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Refreshes and re-indexes the list of connected gamepads.</p>
|
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Remarks-4" class="tsd-anchor"></a>Remarks<a href="#Remarks-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method updates the list of gamepads to exclude any that are undefined.
|
|
It corrects the index of each gamepad to account for any previously undefined entries,
|
|
ensuring that all gamepads are properly indexed and can be accurately referenced within the game.</p>
|
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L327">src/inputs-controller.ts:327</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="resetConfigs" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>reset<wbr/>Configs</span><a href="#resetConfigs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="resetConfigs.resetConfigs-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">reset<wbr/>Configs</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#resetConfigs.resetConfigs-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L575">src/inputs-controller.ts:575</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setChosenGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Gamepad</span><a href="#setChosenGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setChosenGamepad.setChosenGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">gamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setChosenGamepad.setChosenGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the currently chosen gamepad and initializes related settings.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L209">src/inputs-controller.ts:209</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setChosenKeyboardLayout" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><a href="#setChosenKeyboardLayout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setChosenKeyboardLayout.setChosenKeyboardLayout-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Chosen<wbr/>Keyboard<wbr/>Layout</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">layoutKeyboard</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setChosenKeyboardLayout.setChosenKeyboardLayout-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the currently chosen keyboard layout and initializes related settings.</p>
|
|
</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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L219">src/inputs-controller.ts:219</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setGamepadSupport" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Gamepad<wbr/>Support</span><a href="#setGamepadSupport" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setGamepadSupport.setGamepadSupport-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Gamepad<wbr/>Support</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setGamepadSupport.setGamepadSupport-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Enables or disables support for gamepad input.</p>
|
|
</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 class="tsd-anchor-link"><a id="Remarks-5" class="tsd-anchor"></a>Remarks<a href="#Remarks-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This method toggles gamepad support. If disabled, it also ensures that all currently pressed gamepad buttons are deactivated to avoid stuck inputs.</p>
|
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L194">src/inputs-controller.ts:194</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setupGamepad" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>setup<wbr/>Gamepad</span><a href="#setupGamepad" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setupGamepad.setupGamepad-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setup<wbr/>Gamepad</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">thisGamepad</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setupGamepad.setupGamepad-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes or updates configurations for connected gamepads.
|
|
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>
|
|
</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/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L289">src/inputs-controller.ts:289</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setupKeyboard" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>setup<wbr/>Keyboard</span><a href="#setupKeyboard" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setupKeyboard.setupKeyboard-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setup<wbr/>Keyboard</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setupKeyboard.setupKeyboard-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes or updates configurations for connected keyboards.</p>
|
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/inputs-controller.ts#L309">src/inputs-controller.ts:309</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#events" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a><a href="#gamepadSupport" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>gamepad<wbr/>Support</span></a><a href="#lastSource" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>last<wbr/>Source</span></a><a href="#moveTouchControlsHandler" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>move<wbr/>Touch<wbr/>Controls<wbr/>Handler</span></a><a href="#selectedDevice" class=""><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></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#assignBinding" class=""><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="#deactivatePressedKey" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>deactivate<wbr/>Pressed<wbr/>Key</span></a><a href="#ensureKeyboardIsInit" class=""><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><a href="#gamepadButtonDown" class=""><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="#gamepadButtonUp" class=""><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><a href="#getActiveConfig" class=""><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="#getConfig" class=""><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="#getConfigKeyboard" class=""><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="#getGamepadsName" class=""><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="#getIconForLatestInputRecorded" class=""><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="#getLastSourceConfig" class=""><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="#getLastSourceDevice" class=""><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="#getLastSourceType" class=""><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><a href="#init" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>init</span></a><a href="#initChosenGamepad" class=""><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="#initChosenLayoutKeyboard" class=""><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="#injectConfig" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inject<wbr/>Config</span></a><a href="#keyboardKeyDown" class=""><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="#keyboardKeyUp" class=""><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><a href="#loseFocus" class=""><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><a href="#onDisconnect" class=""><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="#onReconnect" class=""><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><a href="#refreshGamepads" class=""><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="#resetConfigs" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reset<wbr/>Configs</span></a><a href="#setChosenGamepad" class=""><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="#setChosenKeyboardLayout" class=""><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><a href="#setGamepadSupport" class=""><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="#setupGamepad" class=""><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><a href="#setupKeyboard" class=""><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></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>pokemon-rogue-battle</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|