1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Rep Power

    Website Navigation Using Arrow Keys / Hotkeys

    Im trying to learn how to scroll using arrow keys or hotkeys. Where you're able to use your arrow keys to move side to side and up and down.

    Here are the 2 best examples of how it functions:
    ffffound[dot]com (top right says hotkeys to scroll with)

    Can anyone link me to how to script that? Or even if there's a proper term I should know about to search for tutorials..

    Thanks anyone who can help
  2. #2
  3. Autodidact
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Rep Power
    Welcome to DevShed, bookoctopus

    jQuery aside, you want to capture the events taking place in the browser, and in particular, the keydown or keyup events. You then have to note the keycode of the pressed key. For example, keycode 37 is the left arrow key, while 39 is the right. If there is a match, do what you will.

    There are some quirks regarding keycodes, the method for grabbing the keycode, and the keydown vs keypress events; nevertheless, they're minor, and have been explained in most tutorials I ever read about this topic.

    The tutorials you want are out there, and there are no obscure search terms required to find them.
    Soldiers, from the height of these pyramids forty centuries look down upon you.
    ▪ Napoleon, on the eve of the Battle of the Pyramids

IMN logo majestic logo threadwatch logo seochat tools logo