Take the 2-minute tour ×

I have a web site with four options. A friend mentioned that his old phone had no touch screen but did have a browser, and had a physical button on each of the four edges.

He asked, if I mapped the four keyboard arrows to the four website options, maybe his phone buttons would emulate them. Is this crazy? Can this be done in javascript? I realize it depends on the phone, but are there general rules?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Rather than map the arrows and disabling the default behavior the user expects, you could try add the mobile access key at your anchors.

Old phones with keyboard accept the attribute accesskey in anchors. This way, if they press the keyboard number related, it will be the same effect as clicking in the link. You could try this but of course, will not work with devices with no keyboard (touch ones mostly).

Use is: <a href="some url" accesskey="1">My link</a> - The number in accesskey will be the number to be pressed on keyboard.

(PS.: Pending test on newer ones with keyboard to see if that tag is still supported).

share|improve this answer
Thanks! This is exactly what I was looking for. I accept that my site won't work with every possible browser, but I want to do what I can. Thanks again. –  Chris Tolworthy Jan 2 '12 at 14:50

I think it highly unlikely to assume that a physical button press is the same as an arrow press. Would a mousewheel be an arrow press, a spacebar, a touch and drag on a touch screen device?

Best way to check is just to try. Visit this site. Try some button presses. If they map to arrows then the displayed keycode will be 37, 38, 39 or 40


share|improve this answer
Thanks. Unfortunately my friend no longer has his old phone. With so mnay phones on the market I wondered if there were general rules, any "best practice". –  Chris Tolworthy Jan 2 '12 at 10:21

Your Answer


