From ce19c3413a33bcdabb5d71ec713555b540b12c84 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 27 Jun 2010 20:52:45 +0200 Subject: 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. --- lib/scripts/hotkeys.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/scripts') 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 - * @return b boolean + * @return b boolean */ this.onkeyup = function(e) { var t = this; -- cgit v1.2.3