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/
Try this. Replace “yourDiv” with the ID of your div