Skip to content

Instantly share code, notes, and snippets.

@thatmarvin
Last active September 16, 2015 08:26
Show Gist options
  • Save thatmarvin/206e6660b0d8808aec93 to your computer and use it in GitHub Desktop.
Save thatmarvin/206e6660b0d8808aec93 to your computer and use it in GitHub Desktop.
Overcast.fm Keyboard Shortcuts
// ==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