diff --git a/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-service.js b/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-service.js index 959f37a3..01e47cab 100644 --- a/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-service.js +++ b/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-service.js @@ -1,20 +1,22 @@ module.exports = function ScopedHotkeysServiceFactory(hotkeys, $filter) { return function (scope, hotkeySet) { - function hotkeyAdd(combo, desc, cb) { + function hotkeyAdd(combo, desc, callback, preventDefault) { hotkeys.add({ combo: combo, description: $filter('translate')(desc), - allowIn: ['textarea'], + allowIn: ['textarea', 'input'], callback: function (event) { - event.preventDefault() - cb() + if (preventDefault || typeof preventDefault === 'undefined') { + event.preventDefault() + } + callback() } }) } angular.forEach(hotkeySet, function (value) { - hotkeyAdd(value[0], value[1], value[2]) + hotkeyAdd(value[0], value[1], value[2], value[3]) }) scope.$on('$destroy', function () { diff --git a/res/app/control-panes/control-panes-hotkeys-controller.js b/res/app/control-panes/control-panes-hotkeys-controller.js index e80fc9d1..ae817aff 100644 --- a/res/app/control-panes/control-panes-hotkeys-controller.js +++ b/res/app/control-panes/control-panes-hotkeys-controller.js @@ -70,26 +70,33 @@ module.exports = } else { $rootScope.platform = 'web' } + }, + scale: function () { + // TODO: scale size } } ScopedHotkeysService($scope, [ //['shift+up', gettext('Previous Device'), actions.previousDevice], //['shift+down', gettext('Next Device'), actions.nextDevice], - ['shift+d', gettext('Go to Device List'), actions.deviceList], + ['command+shift+d', gettext('Go to Device List'), actions.deviceList], ['shift+space', gettext('Selects Next IME'), actions.switchCharset], ['command+left', gettext('Rotate Left'), actions.rotateLeft], ['command+right', gettext('Rotate Right'), actions.rotateRight], + //['command+1', gettext('Scale 100%'), actions.scale], + //['command+2', gettext('Scale 75%'), actions.scale], + //['command+3', gettext('Scale 50%'), actions.scale], + //['shift+l', gettext('Focus URL bar'), actions.focusUrlBar], //['shift+s', gettext('Take Screenshot'), actions.takeScreenShot], - ['shift+m', gettext('Press Menu button'), actions.pressMenu], - ['shift+h', gettext('Press Home button'), actions.pressHome], - ['shift+b', gettext('Press Back button'), actions.pressBack], + ['command+shift+m', gettext('Press Menu button'), actions.pressMenu], + ['command+shift+h', gettext('Press Home button'), actions.pressHome], + ['command+shift+b', gettext('Press Back button'), actions.pressBack], //['shift+i', gettext('Show/Hide device'), actions.toggleDevice], - ['shift+w', gettext('Toggle Web/Native'), actions.togglePlatform] + ['shift+w', gettext('Toggle Web/Native'), actions.togglePlatform, false] ]) }