Closed thasner closed 9 years ago
Prevent default simply prevents the default browser behaviors from firing. If you want those two combos to be exclusive, set is_exclusive to true on both of those combos and when you press "meta enter" the "enter" combo will not trigger.
thanks so much!
Hey @dmauro ,
This still doesn't seem to be working properly for me. When I create on_keydown handlers for "enter" and "meta enter", both with is_exclusive set to true, only the "meta enter" handler works. The "enter" handler doesn't ever trigger (even when the enter key is pressed in isolation).
Is this the intended behavior?
Hi @dmauro and @thasner,
I'm also experiencing the same issue in Chrome and FF on OS X. The following code fires the shift tab
callback when shift tab
is pressed. However, it doesn't fire the tab
callback at all.
keypressListener.register_many([
{
"keys" : "shift tab",
"is_exclusive" : true,
"on_keydown" : function() {
console.log("You pressed shift + tab");
}
},
{
"keys" : "tab",
"is_exclusive" : true,
"on_keydown" : function() {
console.log("You pressed tab");
}
}
]);
If I set either or both is_exclusive
to false
then the behavior is that pressing tab
calls the tab
callback. Pressing shift tab
calls both the tab
and shift tab
callbacks.
Is this a bug or possibly faulty combo configuration?
-- Side note: Enjoying the library, keep up the great work.
verified on Windows 7 chrome, IE11, and firefox