Skip to content

Commit

Permalink
ignoring (arrow) keys when the ALT key is pressed
Browse files Browse the repository at this point in the history
Without this patch, deck.js was capturing ALT+arrow events which are
use by some people to navigate their browsing history (back/forward).
  • Loading branch information
twitwi committed May 6, 2015
1 parent 8bc02e4 commit a41d28c
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 a41d28c

Please sign in to comment.