diff options
author | Andreas Gohr <andi@splitbrain.org> | 2010-06-27 20:52:45 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2010-06-27 20:52:45 +0200 |
commit | ce19c3413a33bcdabb5d71ec713555b540b12c84 (patch) | |
tree | fd5790ed7295b5666152f56c7c062359db3151d4 | |
parent | 09edb7113c19b07ca11a79c2b0571f45ed2cc2eb (diff) | |
download | rpg-ce19c3413a33bcdabb5d71ec713555b540b12c84.tar.gz rpg-ce19c3413a33bcdabb5d71ec713555b540b12c84.tar.bz2 |
Use OS based Hotkey-Modifier FS#1958
Because ALT-GR fires a CTRL-ALT event on Windows systems, but ALT-GR is
needed to write square brackets on German Keyboards, CTRL-ALT can not be
used as modifier.
This patch introdues OS dependent modifiers. Mac systems continue to use
CTRL-ALT, all other systems use only ALT.
Let's hope this works out.
-rw-r--r-- | lib/scripts/hotkeys.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/scripts/hotkeys.js b/lib/scripts/hotkeys.js index 2b6fb6d96..c340c7f02 100644 --- a/lib/scripts/hotkeys.js +++ b/lib/scripts/hotkeys.js @@ -1,6 +1,6 @@ /** * Some of these scripts were taken from TinyMCE (http://tinymce.moxiecode.com/) and were modified for DokuWiki - * + * * Class handles accesskeys using javascript and also provides ability * to register and use other hotkeys as well. * @@ -17,6 +17,8 @@ function Hotkeys() { * this.modifier = 'ctrl+alt+shift'; * this.modifier = 'alt'; * this.modifier = 'alt+shift'; + * + * overwritten in intitialize (see below) */ this.modifier = 'ctrl+alt'; @@ -34,6 +36,14 @@ function Hotkeys() { */ this.initialize = function() { var t = this; + + //switch modifier key based on OS FS#1958 + if(is_macos){ + t.modifier = 'ctrl+alt'; + }else{ + t.modifier = 'alt'; + } + /** * Lookup all anchors with accesskey and register event - go to anchor * target. @@ -97,7 +107,7 @@ function Hotkeys() { * * @param e KeyboardEvent * @author Marek Sacha <sachamar@fel.cvut.cz> - * @return b boolean + * @return b boolean */ this.onkeyup = function(e) { var t = this; |