Last active
September 16, 2015 08:26
-
-
Save thatmarvin/206e6660b0d8808aec93 to your computer and use it in GitHub Desktop.
Overcast.fm Keyboard Shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Overcast.fm Keyboard Shortcuts | |
// @namespace http://your.homepage/ | |
// @version 0.2 | |
// @description Space bar to play/pause, left/right arrow to seek forward/backward. | |
// @author @thatmarvin | |
// @match https://overcast.fm/+* | |
// @grant none | |
// ==/UserScript== | |
(function (window) { | |
var SPACE_BAR_KEY = 32; | |
var LEFT_ARROW_KEY = 37; | |
var RIGHT_ARROW_KEY = 39; | |
$(window).keydown(function (event) { | |
switch (event.which) { | |
case SPACE_BAR_KEY: | |
$('#playpausebutton')[0].click(); | |
event.preventDefault(); | |
break; | |
case LEFT_ARROW_KEY: | |
$('#seekbackbutton')[0].click(); | |
break; | |
case RIGHT_ARROW_KEY: | |
$('#seekforwardbutton')[0].click(); | |
break; | |
} | |
}); | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment