More combination possibilities.

This commit is contained in:
Nicolas Stepien 2011-06-24 03:27:33 +02:00
parent e30db0dc6f
commit 1a0e537d79
2 changed files with 49 additions and 50 deletions

View File

@ -722,18 +722,16 @@
if (!e.shiftKey) {
key = key.toLowerCase();
}
if (e.ctrlKey) {
key = 'ctrl+' + key;
}
if (e.altKey) {
key = 'alt+' + key;
}
} else {
if (kc === 27) {
key = 'Esc';
} else if ((48 <= kc && kc <= 57)) {
key = String.fromCharCode(kc);
}
} else if ((48 <= kc && kc <= 57)) {
key = String.fromCharCode(kc);
} else if (kc === 27) {
key = 'Esc';
}
if (e.altKey) {
key = 'alt+' + key;
}
if (e.ctrlKey) {
key = 'ctrl+' + key;
}
keybinds.key = key;
thread = nav.getThread();
@ -1089,31 +1087,32 @@
keybind: function(e) {
var kc, key;
e.preventDefault();
e.stopPropagation();
kc = e.keyCode;
if ((65 <= kc && kc <= 90)) {
key = String.fromCharCode(kc);
if (!e.shiftKey) {
key = key.toLowerCase();
}
if (e.ctrlKey) {
key = 'ctrl+' + key;
}
if (e.altKey) {
key = 'alt+' + key;
}
} else {
if (kc === 27) {
key = 'Esc';
} else if ((48 <= kc && kc <= 57)) {
key = String.fromCharCode(kc);
} else if (kc === 8) {
key = '';
} else {
key = this.value;
}
} else if ((48 <= kc && kc <= 57)) {
key = String.fromCharCode(kc);
} else if (kc === 27) {
key = 'Esc';
} else if (kc === 8) {
key = '';
}
if (key.length >= 0) {
if (key) {
if (e.altKey) {
key = 'alt+' + key;
}
if (e.ctrlKey) {
key = 'ctrl+' + key;
}
}
this.value = key;
return $.setValue("key/" + this.name, key);
}
this.value = key;
return $.setValue("key/" + this.name, key);
},
time: function(e) {
$.setValue('time', this.value);

View File

@ -517,13 +517,12 @@ keybinds =
key = String.fromCharCode kc
if !e.shiftKey
key = key.toLowerCase()
if e.ctrlKey then key = 'ctrl+' + key
if e.altKey then key = 'alt+' + key
else
if kc is 27
key = 'Esc'
else if 48 <= kc <= 57 #0-9
key = String.fromCharCode kc
else if 48 <= kc <= 57 #0-9
key = String.fromCharCode kc
else if kc is 27
key = 'Esc'
if e.altKey then key = 'alt+' + key
if e.ctrlKey then key = 'ctrl+' + key
keybinds.key = key
thread = nav.getThread()
@ -867,24 +866,25 @@ options =
g.hiddenReplies = {}
keybind: (e) ->
e.preventDefault()
e.stopPropagation()
kc = e.keyCode
if 65 <= kc <= 90 #A-Z
key = String.fromCharCode kc
if !e.shiftKey
key = key.toLowerCase()
if e.ctrlKey then key = 'ctrl+' + key
if e.altKey then key = 'alt+' + key
else
if kc is 27
key = 'Esc'
else if 48 <= kc <= 57 #0-9
key = String.fromCharCode kc
else if kc is 8
key = ''
else
key = @value
@value = key
$.setValue "key/#{@name}", key
else if 48 <= kc <= 57 #0-9
key = String.fromCharCode kc
else if kc is 27
key = 'Esc'
else if kc is 8
key = ''
if key.length >= 0
if key
key = 'alt+' + key if e.altKey
key = 'ctrl+' + key if e.ctrlKey
@value = key
$.setValue "key/#{@name}", key
time: (e) ->
$.setValue 'time', @value
Time.foo()