mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 10:20:22 +00:00
25 lines
895 B
HTML
25 lines
895 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script src="gamepad-helper.js"></script>
|
|
<script>
|
|
asyncTest(async (done) => {
|
|
const gamepad = internals.connectVirtualGamepad();
|
|
await handleSDLInputEvents();
|
|
listenForGamepadConnected();
|
|
|
|
for (const button of gamepad.buttons) {
|
|
println(`Before pressing button ${button}: ${getStringifiedGamepads()}`);
|
|
gamepad.setButton(button, true);
|
|
await handleSDLInputEvents();
|
|
println(`After pressing button ${button}: ${getStringifiedGamepads()}`);
|
|
gamepad.setButton(button, false);
|
|
await handleSDLInputEvents();
|
|
println(`After unpressed button: ${getStringifiedGamepads()}`);
|
|
}
|
|
|
|
listenForGamepadDisconnected();
|
|
gamepad.disconnect();
|
|
await handleSDLInputEvents();
|
|
done();
|
|
});
|
|
</script>
|