mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 00:40:07 +02:00
better keyup stuff
This commit is contained in:
parent
c5615fe15a
commit
3d02036a54
3 changed files with 28 additions and 12 deletions
|
@ -1,6 +1,8 @@
|
|||
var _ = require('underscore');
|
||||
var Backbone = require('backbone');
|
||||
|
||||
var Main = require('../app');
|
||||
|
||||
var mapKeycodeToKey = function(keycode) {
|
||||
// HELP WANTED -- internationalize? Dvorak? I have no idea
|
||||
var keyMap = {
|
||||
|
@ -25,11 +27,11 @@ function KeyboardListener(options) {
|
|||
}
|
||||
|
||||
KeyboardListener.prototype.listen = function() {
|
||||
$(document).bind('keydown', this.keydownListener);
|
||||
Main.getEventBaton().stealBaton('docKeydown', this.keydownListener, this);
|
||||
};
|
||||
|
||||
KeyboardListener.prototype.mute = function() {
|
||||
$(document).unbind('keydown', this.keydownListener);
|
||||
Main.getEventBaton().releaseBaton('docKeydown', this.keydownListener, this);
|
||||
};
|
||||
|
||||
KeyboardListener.prototype.keydown = function(e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue