mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
feature : add keyboard shortcuts
+ decentralized shortcut declaration + each service/controller is now responsible for declaring its shorcuts - documentation (cheatsheet) is still to be maintained manually - init order matters (shortcutService has to be instanciated before everyone else) => should have a standalone KeyboardService singleton which is ready as soon as it is loaded
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
(function () {
|
||||
var specialKeys = {
|
||||
191 : "?"
|
||||
191 : "?",
|
||||
27 : "esc",
|
||||
38 : "up",
|
||||
40 : "down"
|
||||
};
|
||||
|
||||
var ns = $.namespace('pskl.service.keyboard');
|
||||
@ -11,7 +14,7 @@
|
||||
// key is 0-9
|
||||
return (keycode - 48) + "";
|
||||
} else if (keycode >= 65 && keycode <= 90) {
|
||||
// key is a-z, we'll use base 36 to get the string representation
|
||||
// key is a-z, use base 36 to get the string representation
|
||||
return (keycode - 65 + 10).toString(36);
|
||||
} else {
|
||||
return specialKeys[keycode];
|
||||
|
Reference in New Issue
Block a user