ctrl.js

ctrl.js is a bookmarklet that allows you and your friends to connect your phones to the browser to play HTML5 games.

Instructions

Simply activate the bookmarklet and scan the QR Code with your phone’s default camera app to connect.

How it works

The QR Code contains a link to the peer.js session running in the bookmarklet, allowing it to find your browser and form P2P connection

Events on the phone will then inject themselves as spoofed Keyboard KeyEvents into the body of the web page you are on.

Keymappings
Controller Button Keypress
Up w
Left a
Down s
Right d
A Space
B Shift
Start Enter

These keymappings can be changed by clicking on the player's name above the QR Code, and are stored locally on a per-page basis.

Open Source

The source code to ctrl.js is available under the MIT License at Github.

Credits

ctrl.js is based on peer.js, qrcode.js, three.js, and Skeleton.css.

Raw Events
ctrl.js Events will appear here upon connection.