2

I need to define shortcut keys Ctrl+. and Ctrl+/ to my extension's functions.

Here is what I have in my browser.xul overlay:

<keyset id="mainKeyset">
    <key oncommand="window.alert('SLASH')" 
             id="cue-cmd-1"
             keycode="VK_SLASH"
             modifiers="accel"
                />
    <key oncommand="window.alert('PERIOD')" 
             id="cue-cmd-2"
             keycode="VK_PERIOD"
             modifiers="accel"
                />
</keyset>

The overlay merges successfully. However the shortcut keys do not work.

If I change keycode="VK_PERIOD" to key="." and similarly keycode="VK_SLASH" to key="/", shortcuts keys work as expected.

Since I am allowing users to assign their preferred shortcuts to commands, I need to use keycode attribute in order to be able to use shift modifier key.

What am I missing?

Makyen
  • 31,849
  • 12
  • 86
  • 121
Kashif
  • 1,238
  • 10
  • 15
  • Thats interesting, thanks for the note on the the test using `key`. I thought it would work, ill ttest this out. – Noitidart Dec 30 '14 at 20:57

1 Answers1

0

modifiers="accel" is only ctrl on windows and linux, it is cmd on osx.

Try using modifiers="control" instead.

erikvold
  • 15,988
  • 11
  • 54
  • 98
  • Same results with ````modifiers="control"````. On a side note, AFAIK using ````control```` won't work on MAC. – Kashif Jan 03 '15 at 00:01