-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgamepad-tester.html
More file actions
213 lines (199 loc) · 11.6 KB
/
Copy pathgamepad-tester.html
File metadata and controls
213 lines (199 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
---
title: Gamepad Tester
layout: page
full-width: true
css:
- /assets/css/hide-heading.css
- /assets/css/gamepad-tester.css
ext-js:
- href: "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.5.0/chart.umd.min.js"
sri: "sha512-Y51n9mtKTVBh3Jbx5pZSJNDDMyY+yGe77DGtBPzRlgsf/YLCh13kSZ3JmfHGzYFCmOndraf0sQgfM654b7dJ3w=="
- href: "https://cdn.jsdelivr.net/npm/@lizardbyte/gamepad-helper@2026.219.34512/dist/gamepad-helper.js"
js:
- /assets/js/gamepad-tester.js
---
<script>
globalThis.gamepadHelperVersion = "{{ site.data.licenses.gamepad-helper.version }}";
</script>
<!-- Gamepad Tester section -->
<section class="gamepad-tester py-4 py-lg-5" id="GamepadTester">
<div class="container">
<header class="gamepad-tester-header mx-auto text-center">
<div class="gamepad-kicker mb-2">
<i class="fas fa-gamepad" aria-hidden="true"></i>
Browser controller diagnostics
</div>
<h2 class="display-6 fw-bolder mb-2">Gamepad Tester</h2>
<p class="lead text-muted mb-4">Check buttons, sticks, triggers, axes, and vibration in real time.</p>
<output id="gamepad-status" class="alert alert-warning gamepad-status mb-2" aria-live="polite">
<span class="gamepad-status-indicator" aria-hidden="true"></span>
<span id="gamepad-status-message">No gamepad detected. Connect a gamepad and press any button.</span>
</output>
<p class="gamepad-privacy-note text-muted mb-0">
<i class="fas fa-lock me-1" aria-hidden="true"></i>
Input data stays in your browser.
</p>
</header>
<section class="gamepad-selector-panel mt-4" id="gamepad-selector-container" style="display: none;" aria-labelledby="gamepad-selector-heading">
<div class="gamepad-selector-heading">
<div>
<span class="gamepad-panel-eyebrow">Devices</span>
<h3 class="h5 mb-0" id="gamepad-selector-heading">Connected controllers</h3>
</div>
<span class="small text-muted">Choose a controller to inspect</span>
</div>
<div class="gamepad-selector-grid" id="gamepad-selector"></div>
</section>
<div class="row g-4 mt-0" id="gamepad-info" style="display: none;">
<div class="col-12">
<section class="gamepad-panel gamepad-visual-panel" aria-labelledby="controller-visual-heading">
<div class="gamepad-panel-header">
<div>
<span class="gamepad-panel-eyebrow">Live input</span>
<h3 class="h5 mb-0" id="controller-visual-heading">Controller visual</h3>
</div>
<span class="gamepad-live-badge"><span aria-hidden="true"></span>Live</span>
</div>
<div class="gamepad-panel-body gamepad-visual-body">
<div id="controller-visual" class="gamepad-visual">
<span class="text-muted">A visual is not available for this controller.</span>
</div>
</div>
</section>
</div>
<div class="col-lg-8">
<section class="gamepad-panel h-100" aria-labelledby="buttons-heading">
<div class="gamepad-panel-header">
<div>
<span class="gamepad-panel-eyebrow">Digital and analog</span>
<h3 class="h5 mb-0" id="buttons-heading">Buttons</h3>
</div>
<span class="small text-muted">Press or hold any button</span>
</div>
<div class="gamepad-panel-body">
<div id="buttons-container" class="gamepad-button-grid"></div>
</div>
</section>
</div>
<div class="col-lg-4">
<section class="gamepad-panel h-100" aria-labelledby="sticks-heading">
<div class="gamepad-panel-header">
<div>
<span class="gamepad-panel-eyebrow">Position</span>
<h3 class="h5 mb-0" id="sticks-heading">Sticks</h3>
</div>
</div>
<div class="gamepad-panel-body">
<div class="row g-3">
<div class="col-6">
<div class="stick-container text-center">
<h4 class="gamepad-stick-label">Left stick</h4>
<div class="position-relative mx-auto stick-circle">
<div id="left-stick-position" class="position-absolute stick-position"></div>
<div class="position-absolute stick-line-vertical"></div>
<div class="position-absolute stick-line-horizontal"></div>
</div>
</div>
</div>
<div class="col-6">
<div class="stick-container text-center">
<h4 class="gamepad-stick-label">Right stick</h4>
<div class="position-relative mx-auto stick-circle">
<div id="right-stick-position" class="position-absolute stick-position"></div>
<div class="position-absolute stick-line-vertical"></div>
<div class="position-absolute stick-line-horizontal"></div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="col-lg-8">
<section class="gamepad-panel h-100" aria-labelledby="axes-heading">
<div class="gamepad-panel-header">
<div>
<span class="gamepad-panel-eyebrow">Range -1.00 to 1.00</span>
<h3 class="h5 mb-0" id="axes-heading">Axes</h3>
</div>
<span class="small text-muted">Centered at zero</span>
</div>
<div class="gamepad-panel-body">
<div class="gamepad-axis-grid" id="axes-container"></div>
</div>
</section>
</div>
<div class="col-lg-4">
<section class="gamepad-panel h-100" aria-labelledby="vibration-heading">
<div class="gamepad-panel-header">
<div>
<span class="gamepad-panel-eyebrow">Haptics</span>
<h3 class="h5 mb-0" id="vibration-heading">Vibration</h3>
</div>
</div>
<div class="gamepad-panel-body">
<div id="vibration-status" class="gamepad-capability mb-3"></div>
<div id="dual-rumble-controls" class="d-none">
<div class="gamepad-range-control">
<label for="vibration-weak">Weak motor <output id="weak-value">0.1</output></label>
<input type="range" class="form-range" id="vibration-weak" min="0" max="1" step="0.01" value="0.1">
</div>
<div class="gamepad-range-control">
<label for="vibration-strong">Strong motor <output id="strong-value">0.1</output></label>
<input type="range" class="form-range" id="vibration-strong" min="0" max="1" step="0.01" value="0.1">
</div>
</div>
<div id="simple-vibration-controls" class="d-none">
<div class="gamepad-range-control">
<label for="vibration-magnitude">Magnitude <output id="magnitude-value">0.5</output></label>
<input type="range" class="form-range" id="vibration-magnitude" min="0" max="1" step="0.01" value="0.5">
</div>
</div>
<div id="vibration-duration-controls" class="gamepad-range-control">
<label for="vibration-duration">Duration <span><output id="duration-value">1000</output> ms</span></label>
<input type="range" class="form-range" id="vibration-duration" min="100" max="5000" step="100" value="1000">
</div>
<div class="d-flex gap-2" id="vibration-buttons">
<button id="vibrate-btn" class="btn btn-primary flex-grow-1">
<i class="fas fa-wave-square me-1" aria-hidden="true"></i>Vibrate
</button>
<button id="stop-vibration-btn" class="btn btn-outline-danger">
<i class="fas fa-stop me-1" aria-hidden="true"></i>Stop
</button>
</div>
<div id="vibration-unsupported" class="d-none">
<div class="gamepad-inline-notice">
<i class="fas fa-info-circle" aria-hidden="true"></i>
Vibration is not available for this controller or browser.
</div>
</div>
</div>
</section>
</div>
<div class="col-12">
<details class="gamepad-panel gamepad-device-details">
<summary>
<span>
<span class="gamepad-panel-eyebrow">Technical information</span>
<span class="h5 d-block mb-0">Controller details</span>
</span>
<span class="gamepad-details-action text-muted">Show details <i class="fas fa-chevron-down" aria-hidden="true"></i></span>
</summary>
<div class="gamepad-panel-body">
<div class="gamepad-details-grid mb-0">
<dl class="gamepad-detail gamepad-detail-wide"><dt>Name</dt><dd id="gamepad-name">-</dd></dl>
<dl class="gamepad-detail gamepad-detail-wide"><dt>Device ID</dt><dd id="gamepad-id">-</dd></dl>
<dl class="gamepad-detail"><dt>Type</dt><dd id="gamepad-type">-</dd></dl>
<dl class="gamepad-detail"><dt>Mapping</dt><dd id="gamepad-mapping">-</dd></dl>
<dl class="gamepad-detail"><dt>Index</dt><dd id="gamepad-index">-</dd></dl>
<dl class="gamepad-detail"><dt>Connected</dt><dd id="gamepad-connected">-</dd></dl>
<dl class="gamepad-detail"><dt>Buttons</dt><dd id="gamepad-buttons-count">-</dd></dl>
<dl class="gamepad-detail"><dt>Axes</dt><dd id="gamepad-axes-count">-</dd></dl>
</div>
</div>
</details>
</div>
<pre id="raw-data" class="d-none" aria-hidden="true"></pre>
</div>
</div>
</section>