Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3346142
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:16:07+00:00 2026-05-18T01:16:07+00:00

The jquery.hotkeys plugin lets you easily add and remove handlers for keyboard events. However,

  • 0

The jquery.hotkeys plugin lets you easily add and remove handlers for keyboard events. However, this plugin can handle keyboard event only but not mouse click event. So it does not support something like:

$('#gallery li.icon').bind('click', 'ctrl+leftbutton', function() {
    $(this).addClass('selected');
});

I know this is not difficult to implement, but I am curious if someone has already posted a neat solution for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:16:08+00:00Added an answer on May 18, 2026 at 1:16 am

    You can just check the event’s .ctrlKey property for this, for example:

    $('#gallery li.icon').click(function(e) {
      if(e.ctrlKey) $(this).addClass('selected');
    });
    

    In this we’re just checking if the Ctrl key is down then the click event happened. Just to be clear, .ctrlKey is basic JavaScript, there’s no dependency on the hotkeys plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I merge these in jQuery? I'm using the HotKeys plugin. $(document).bind('keydown', 'n', cycleNoise);
Using this hotkeys plugin, https://github.com/jeresig/jquery.hotkeys , I'm having some problems with the following code:
I'm trying to use https://github.com/stepanvr/js-shortcuts jquery plugin for keyboard shortcuts. However I'm stuck with
I'm using to jQuery.hotkeys to bind keyboard events. I'm trying to bind Ctrl +
I am using the jQuery hotkeys plugin to bind some keypresses to events. I
Basically, I'm using jQuery Hotkeys plugin by Mr Resig to capture and handle shortcuts
I'm using the jQuery hotkeys plugin , written by John Resig (Mr jQuery). It
I am attempting to overwrite a core jQuery event, in this case the keydown
jQuery now allows you to use live to handle custom events, something I've used
I'm using jQuery hotkeys plugin with the following code: $(document).bind('keydown', 'right', function(){ console.log('fired'); display_info();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.