Created
November 10, 2013 03:55
-
-
Save deathcap/7393584 to your computer and use it in GitHub Desktop.
kb-controls mouse test right-click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raf = require('raf') | |
, kb = require('./index') | |
var pre = document.createElement('pre') | |
document.body.appendChild(pre) | |
var ctl = kb({ | |
'<left>': 'strafe_left' | |
, '<right>': 'strafe_right' | |
, '<up>': 'forward' | |
, '<down>': 'backward' | |
, 'W': 'forward' | |
, 'A': 'strafe_left' | |
, 'S': 'backward' | |
, 'D': 'strafe_right' | |
, '<mouse 1>': 'fire1' | |
, '<mouse 2>': 'fire2' | |
, '<mouse 3>': 'fire3' | |
, '<mouse 4>': 'fire4' | |
}) | |
raf(document.body) | |
.on('data', function(dt) { | |
pre.textContents = pre.innerText = JSON.stringify(ctl) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment