views:

264

answers:

1

Anyone know anything about the Links browser? I am developing an application for Links (text mode) that is running on a terminal using Linux. The problem is that none of the 'on key' events (down, up, or press) will register. Here is the Javascript I am using:

<body onload="Alert()" onkeydown="CheckKey(event.keyCode)">

    <script type="text/javascript">

       function CheckKey(keycode) {
          alert(keycode)
       }

       function Alert(){
           alert("onload is working")
       }  

    </script>

    <!--A table goes here-->

</body>

The onload event is working fine, so I know that Javascript is enabled for the browser, but the onkeydown event does nothing. The problem is, I don't know if it is an issue with Links, Javascript, or possibly even a restriction of the terminal that it is running on. Was there a version of Javascript that didn't support 'onkey' events? Just a thought...

Any help would be appreciated!

A: 

I don't think that they will work. Links uses key commands for it's own navigation, I think that it's just not passing them to your script.

moshen
I wondered about that... is there anyway to customize commands for keys that Links doesn't use?
TrailJon
I'm not sure. Trying examples on other sites ( http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeydown ) do not work either. This may just be a links issue, is there a specific reason you need to support links?
moshen
Links is the browser that comes out of the box with the Linux distro. loaded on the terminals, so we need to stick with that if at all possible. I'm still digging... I'll let you know if this answer is correct or if i find something else. Thanks for the input.
TrailJon
Just verified: Javascript onkey events aren't supported in Links version 2
TrailJon