3

I am trying to allow my CMS users to click certain controls with ALT+CTRL both pressed, but this results in the context menu being shown, because CTRL+Leftclick simulates a Rightclick, at least here on Mac OSX (which is the primary OS of my client).

The question is: how can I stop the context menu from popping up but still make sure my click goes through to the element it is being triggered on?

I tried oncontextmenu="return false;" in my <body> for testing purposes. It would properly prevent the menu from popping up, but my click event would not go through.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SquareCat
  • 5,699
  • 9
  • 41
  • 75
  • pick a different shortcut would be my advice from a UX standpoint. – zzzzBov Nov 25 '11 at 03:50
  • Good point, i have a hard time parting with the old habits, and so have my clients, but perhaps it is the only way? Anyone know if i can check for the FN key on a Mac? – SquareCat Nov 25 '11 at 15:38
  • Firefox has finally begun to add support for custom contextmenu items. That would be the ideal solution but there's practically no support for it as it is. – zzzzBov Nov 25 '11 at 15:40
  • That sounds interesting. In fact in my situation that would be an option, as i decided to limit CMS usage to Firefox exclusively. – SquareCat Nov 25 '11 at 15:46
  • It's [new in Firefox 8](https://developer.mozilla.org/en/Firefox_8_for_developers), and the [bugs are still being worked](https://bugzilla.mozilla.org/show_bug.cgi?id=617528) on, but there's a [nice demo](http://people.mozilla.com/~prouget/bugs/context-menu-test/test.html) at least. – zzzzBov Nov 25 '11 at 15:49
  • Good stuff! But do you think i would be able to turn the menu off completely to achieve the desired effect? – SquareCat Nov 25 '11 at 16:09

1 Answers1

1

As i was unable to properly solve this problem by fiddling around with the way the browser behaves in regard to the context menu, i went for a different approach and bound the META key instead of the CTRL key. Works well this way. I'll leave the q/a in for others.

SquareCat
  • 5,699
  • 9
  • 41
  • 75