Immediate rebind.

This commit is contained in:
Nicolas Stepien 2011-06-24 22:22:54 +02:00
parent 278ff8a2e2
commit 17cc6262b1
2 changed files with 5 additions and 1 deletions

View File

@ -1134,6 +1134,7 @@
keybind: function(e) {
var kc, key;
e.preventDefault();
e.stopPropagation();
kc = e.keyCode;
if ((65 <= kc && kc <= 90)) {
key = String.fromCharCode(kc);
@ -1157,7 +1158,8 @@
}
}
this.value = key;
return $.setValue("key/" + this.name, key);
$.setValue("key/" + this.name, key);
return keybinds[this.name] = key;
}
},
time: function(e) {

View File

@ -905,6 +905,7 @@ options =
g.hiddenReplies = {}
keybind: (e) ->
e.preventDefault()
e.stopPropagation()
kc = e.keyCode
if 65 <= kc <= 90 #A-Z
key = String.fromCharCode kc
@ -923,6 +924,7 @@ options =
key = 'ctrl+' + key if e.ctrlKey
@value = key
$.setValue "key/#{@name}", key
keybinds[@name] = key
time: (e) ->
$.setValue 'time', @value
Time.foo()