Skip to content

Commit

Permalink
Merge pull request #5 from keheitz/master
Browse files Browse the repository at this point in the history
Added keydown function to toggle buttons with left and right keyboard
  • Loading branch information
cathydeng committed Jul 27, 2016
2 parents ad43073 + bfd5335 commit fc60101
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ <h1>who's talking?</h1>
not_dude_t = setInterval(tally_not_dude, 1000)
}
});

$('body').keydown(function(e) {
if(e.keyCode == 37) {// left
$dude.trigger('click');
}
else if(e.keyCode == 39) {//right
$not_dude.trigger('click');
}
});


});

Expand Down

0 comments on commit fc60101

Please sign in to comment.