Created
September 27, 2011 12:47
-
-
Save aerith/1244978 to your computer and use it in GitHub Desktop.
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
(function (ns, w, d, $) { | |
var harukaze = ns.harukaze = $.extend({}, ns.harukaze); | |
var _key_stacks = []; | |
harukaze.keybind = { | |
keystack: { | |
push: function (code) { | |
_key_stacks.push(code); | |
}, | |
pop: function () { | |
_key_stacks.pop(); | |
}, | |
clear: function () { | |
_key_stacks = []; | |
}, | |
characters: function () { | |
var keystack = this; | |
return $.map(_key_stacks, function () { | |
return keystack.convert(this); | |
}).join(''); | |
}, | |
mixed: function () { | |
return { | |
characters: this.characters(), | |
shiftkey: this.shiftkey(), | |
ctrlkey: this.ctrlkey(), | |
metakey: this.metakey() | |
} | |
} | |
} | |
}; | |
})(this, window, document, jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment