Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Using JavaScript with OnContextMenu and event.shiftKey at the same time
  • I can use OnContextMenu() to detect right-clicks.
  • I can use event.shiftKey to detect if the user is holding down the shift key.
  • But I can't seem to get BOTH working at the same time, but only in FireFox. (Chrome works fine)
  • FireFox just displays the normal right-click menu instead

https://jsfiddle.net/pf1grqx8/

<div style='border:1px solid black; width:555px;' oncontextmenu='return Test(event);'>
Ctrl + rightClick works <br><br>
Shift + rightClick does not work in Firefox (but works ok in Chrome)
</div>

and

function Test(e)
{
    alert(e.ctrlKey + "\n\n" +  e.shiftKey);
    return false;
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!