Skip to content

Commit

Permalink
Merge pull request imakewebthings#183 from twitwi/prevent-arrow-keys-…
Browse files Browse the repository at this point in the history
…with-alt

ignoring (arrow) keys when the ALT key is pressed
  • Loading branch information
imakewebthings committed May 9, 2015
2 parents 8bc02e4 + a41d28c commit 2b0c6de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/deck.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ that use the API provided by core.
].join(', ');

$document.unbind('keydown.deck').bind('keydown.deck', function(event) {
if (event.altKey) {
// ignore events when the ALT key is down
// NB: browsers use ALT+arrow to navigate history
return;
}
var isNext = event.which === options.keys.next;
var isPrev = event.which === options.keys.previous;
isNext = isNext || $.inArray(event.which, options.keys.next) > -1;
Expand Down

0 comments on commit 2b0c6de

Please sign in to comment.