ctrl.js is a bookmarklet that allows you and your friends to connect your phones to the browser to play HTML5 games.
Simply activate the bookmarklet and scan the QR Code with your phone’s default camera app to connect.
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.
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.
The source code to ctrl.js is available under the MIT License at Github.
ctrl.js is based on peer.js, qrcode.js, three.js, and Skeleton.css.
ctrl.js Events will appear here upon connection.