Issue #287 : Shortcuts now rely on Shortcut instances. Shortcut key can be changed dynamically.

This commit is contained in:
jdescottes
2015-10-10 19:32:25 +02:00
parent 8081d5e232
commit ca3bbf1c57
35 changed files with 597 additions and 185 deletions

View File

@@ -37,9 +37,10 @@
$.subscribe(Events.SECONDARY_COLOR_SELECTED, this.highlightSelectedColors.bind(this));
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
pskl.app.shortcutService.registerShortcuts(['>', 'shift+>'], this.selectNextColor_.bind(this));
pskl.app.shortcutService.registerShortcuts('123465789'.split(''), this.selectColorForKey_.bind(this));
pskl.app.shortcutService.registerShortcut('<', this.selectPreviousColor_.bind(this));
var shortcuts = pskl.service.keyboard.Shortcuts;
pskl.app.shortcutService.registerShortcut(shortcuts.COLOR.PREVIOUS_COLOR, this.selectPreviousColor_.bind(this));
pskl.app.shortcutService.registerShortcut(shortcuts.COLOR.NEXT_COLOR, this.selectNextColor_.bind(this));
pskl.app.shortcutService.registerShortcut(shortcuts.COLOR.SELECT_COLOR, this.selectColorForKey_.bind(this));
this.fillPaletteList();
this.updateFromUserSettings();