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

  • SEARCH
  • Home
  • 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 6936897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:17:37+00:00 2026-05-27T12:17:37+00:00

I have added the library shortcut.js from http://www.openjs.com/scripts/events/keyboard_shortcuts/ and tried to trigger a function

  • 0

I have added the library shortcut.js from http://www.openjs.com/scripts/events/keyboard_shortcuts/

and tried to trigger a function when CTRL + N is pressed. The function worked perfectly, but since CTRL + N is a new window shortcut in the browser(Mozilla 8) It opened the new window after the function is triggered.

So i want to trigger make CTRL+N shortcut to trigger my function only when the cursor is in a div. if the cursor is not in the div, the browser’s shortcut should work, else if the cursor is inside the div, the browser’s shortcut should get disabled and my function should trigger.

Here is the fiddle which could explain it bettter. http://jsfiddle.net/bala2111/4jBnp/1/

  • 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-27T12:17:38+00:00Added an answer on May 27, 2026 at 12:17 pm

    Try this. Replace “yourDiv” with the ID of your div

    shortcut.add("ctrl+N",function(){"alert("hi")}, {'type':'keydown',
    'propagate':false,
    'target':yourDiv}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a WCF Client with the SVCUTIL.exe following these instructions : http://msdn.microsoft.com/en-us/library/ms733133.aspx
I have recently added the reCaptcha library for CodeIgniter (by copying files from the
I have added references to the System.ServiceModel library, but the WebHttpBinding class is not
I have added the .jars to my library and I can also instantiate other
In my project, i have added another project as a library, Their are some
I have successfully added a dynamic library to a program, but when I try
I have a silverlight library which I have added a wcf service reference. Call
I have an Android java library that uses some native code. I have added
I have added a menu item in edit control block(ECB) in document library(using following
I am writing a library in VB.NET in which I have added, among others,

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.