How to disable developer shortcuts?

Hi,

Is there a way to disable the shortcuts x+x+x+h and x+x+x+a on the entire wiki? I don’t want users to be able to enable viewing hidden info for themselves.

Alan

Hi, see https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/KeyboardShortcuts#HRemovingkeyboardshortcuts

Thanks

1 Like

Where would I put that to have it affect the whole wiki?

Hi,

It seems like both shortcut.remove("x+x+x+a"); shortcut.remove("x x x a"); does not work when I added it to a page. Still not sure how these sequence combos are registered and how to remove them.

Alan

Could you show or describe exactly what you did?

I tried adding this to a page:

{{html clean="false"}}
//<![CDATA[
<script type="text/javascript"> 
    shortcut.remove("x+x+x+a");  
    shortcut.remove("x x x a");
</script>
//]]>
{{/html}}

I could still do x x x a after on that page so it doesn’t seem to work even at a page level. Also tried to put the javascript in Look & Feel > Presentation >HTTP META INFO to try to have it on every page but it does not seem to work either:

<script type='text/javascript'>
//<![CDATA[
setTimeout(function(){
  shortcut.remove("x x x a");
  shortcut.remove("x+x+x+a");
},100);
//]]>
</script>

I can still do the command even after doing this so that doesn’t seem to work. I even put it inside a timeout just to make sure it isn’t trying to remove it before the shortcuts are bound.

Alan

I’ve tried with a JavaScriptExtension (https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SkinExtensionsTutorial/) and it worked fine for me with:

shortcut.remove("x+x+x+a");

Hi, getting back to old topic. Do you know how to disable global shortcuts like Alt-S (save). I’ve tried all methods mentioned but it won’t work. Or rather they still work :slight_smile:
I’m Polish and on my mac Alt-S is used to obtain “ś” polish diacritic character in example.
TIA
Darek

I tried this too but it never worked. I also tried the “Hello World” example from here:
https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SkinExtensionsTutorial/
and it worked at the whole wiki. Has there something changed since your last post.