JQuery Keyboard Shortcuts - Including a Combination, while INSIDE Input / Textarea

I am using jQuery's hotkeys plugin here: https://github.com/tzuryby/jquery.hotkeys

The plugin prevents the launch of hot keys when you are inside the input field.

In my case, I want the hotkey to work when inside the input field, not all but one, in particular:

$(function() {
    $(document).bind('keydown', 'Shift+return',function (evt) {
        alert('got it')
    });
});

Any ideas on how jQuery hotkeys can be fixed to allow shift + to return to launch when inside the / textarea input field? but not for all other hotkey bindings?

thank

+3
source share
1 answer

( document, ). shift+return input, , :

$("#test").bind("keydown", "shift+return", function(event) {
    alert('got it');
});

test - id input, .

: http://jsfiddle.net/andrewwhitaker/vKrM9/

+5

Source: https://habr.com/ru/post/1791607/


All Articles