Skip to content

Instantly share code, notes, and snippets.

@kikairoya
Created January 13, 2017 10:59
Show Gist options
  • Save kikairoya/41a59d1d83b4ad0d357c5adf8ab756d8 to your computer and use it in GitHub Desktop.
Save kikairoya/41a59d1d83b4ad0d357c5adf8ab756d8 to your computer and use it in GitHub Desktop.
jjjjjjjjjjjjjjjjjj
(function() {
function _onkeypress(key) {
switch (key.key) {
case "h":
case "H":
window.scrollBy(-100, 0);
return false;
case "j":
case "J":
window.scrollBy(0, 100);
return false;
case "k":
case "K":
window.scrollBy(0, -100);
return false;
case "l":
case "L":
window.scrollBy(100, 0);
return false;
}
return true;
}
window.addEventListener("keypress", _onkeypress);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment