I am using something like this:
jQuery(document).keydown(function(e){
// code
}
For switching photos in photoalbum with arrow keys.. It works great, but! I want to disable in textarea. Because, if I am commenting a photo and I want to move cursor with arrow keys, I switch photo and lose my text :)
How to disable it? Can I catch, which element is focused? Thank you
Navigate to User Configuration > Administrative Templates > Windows Components > File Explorer. Double-click on the Turn off Windows Key Hotkeys option on the right-hand side.
Select “System Preferences.” Select “Keyboard” from the list on the left side of your screen. Click on “Shortcuts” in the list of settings across the top of the window. Once inside “Shortcuts,” uncheck the box next to each shortcut to disable it.
If you select a command that is bound to a shortcut, within the 'Keyboard' section of the Visual Studio Options dialog, the 'Remove' button should activate. Notice that the 'R' is underlined (which, if isn't, hold the Alt key down).
You can check to see if the target element is a textarea.
jQuery(document).keydown(function(e){
var target = e.target || e.srcElement;
if ( target.tagName !== "TEXTAREA" ) {
// code
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With