Results 1 to 3 of 3

Thread: Looking for a script if you don't have a mouse

  1. #1
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Looking for a script if you don't have a mouse

    Hi All !

    I'm looking for a script with which I can command within my site special words with links (Menus) from the keyboard. An example of what I mean. For instance I don't have a mouse, but want to look around the website. There's the menu like 'Pictures', 'Contact', 'Sport', etc, and if I want to open one of them, just simply press for instance letter P on the keyboard (that refers to Pictures) and off I go to the Pictures area. This would be with Contact and Sports (pressing letter C and S). Just like in eg. Microsoft Internet Explorer pressing ALT F opens the File menu, just that I don't want to use ALT, only one letter, P for Pictures. An other example if you look at the top of this page as you are reading this forum, at the top you'll see" Home - User CP - FAQ ", etc. If you just press H it will do as you have just clikked on Home, U for User CP and F for FAQ.

    I hope I was clear of what I mean. If not please let me know. Thx in advance.

    Dzsedzs

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Most people have mice. If they don't, they can't use most websites anyway.

    Also, the tab key on the keyboard is designed for this: it'll cycle through all elements. It may be slow, but it works.

    Regardless, you just need to create an onkeydown event listener. Try google for that. I'm not sure of the exact code, but I've seen it done often.

    I'm still not sure you need this, but it's possible. Be careful that you don't interfere with other expected functions on the page, though. For example, in firefox when I start typing I like it to search for text on the page. If it started opening menus instead, that would be odd.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Can try this, or using jquery and the keypress function some other way...

    http://www.samburdge.co.uk/developme...r-using-jquery
    Corrections to my coding/thoughts welcome.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •