SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Clarification Accesskey

    Hi,

    I have given the sample code given below,

    Code HTML4Strict:
    <ul>
    	<li><a href="../"                accesskey="h">home</a>
    	<li><a href="_a.html"            accesskey="a">anchor</a>
    	<li><a href="../quicklist.html"  accesskey="q">quicklist</a>
    </ul>

    If i press the alt+h, h and ctrl+h in the keyboard. But not go to the home page. How can i check this in the browsers. its working or not?
    Cheers,
    Dinesh

  2. #2
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    This is the reason why the accesskey attribute shouldn't be used: you can't possibly know which keyboard shortcuts are being used by the visitor, since there are so many browsers with language-dependant shortcuts out there.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on which browser you have. I think Alt+accesskey might work in IE. Firefox uses Shift+Alt+accesskey, if I recall correctly. Opera uses Shift+Esc accesskey.

    But as Christian said, accesskeys are fraught with problems. Especially letters, which are often used for accelerators in the browser itself.
    Birnam wood is come to Dunsinane

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,803
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You have to avoiid all the characters that any browsers use internally when setting up access keys. In practice that limits you to numbers only for your access keys if you want them to almost always work.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, and numbers come with a disadvantage all of their own: it can prevent Windows users from inputting non-keyboard characters using Alt+nnnn on the numeric keypad.

    That's why Opera has used a non-conflicting (albeit awkward) trigger for a long time, and (I assume) why Firefox switched to Shift+Alt instead of just Alt.
    Birnam wood is come to Dunsinane

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,803
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Yes, and numbers come with a disadvantage all of their own: it can prevent Windows users from inputting non-keyboard characters using Alt+nnnn on the numeric keypad.

    That's why Opera has used a non-conflicting (albeit awkward) trigger for a long time, and (I assume) why Firefox switched to Shift+Alt instead of just Alt.
    That's wy I said ALMOST ALWAYS. The numbers are the keys that interfere least with other computer functionality. In practice using accesskey just makes a site less accessible for at least some visitors which is why books on accessibility generally recommend not using it at all.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The numbers are the keys that interfere least with other computer functionality.
    Well, at least other browser functionality.

    Quote Originally Posted by felgall View Post
    In practice using accesskey just makes a site less accessible for at least some visitors which is why books on accessibility generally recommend not using it at all.
    So does mine.
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I'd say computer functionality. Linux is always hijacking my alt key, can't even use it in Gimp properly, though Firefox does seem to be able to hog it if it's opened.

  9. #9
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    It's a shame really, accessibility studies show that when accesskeys are available, disabled individuals make use of them regularly, but the problems with browser implementation has forced them to be abandoned because of the inconsistencies in how they are being deployed.

    As a result I also agree with avoiding the use of accesskeys for those reasons mentioned above.

  10. #10
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Doesn't the BBC still use them though, with numbers? Also Sitepoint?

    They seem more logical for sites an individual will visit regularly, because then it's worth it for the individual to learn the combinations to jump to where they want to go. So usually larger sites.

  11. #11
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Stomme, I know the BBC are starting to phase them out due to the problems they cause, though one thing I would put forward is that if people using assisted devices tend to stick to one browser (due to the learning difficulties and learning curve they may have changing over)... why would the combination matter... surely they would be well used to the combinations require to activate the key (all but the letter or number).

  12. #12
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Sure. BBC is also planning on phasing out Perl, due to fear of not getting enough programmers in the future (because the kids coming out of school these days, they ain't heard of no Perl...).
    I remember Brandon saying he used at least some accesskeys here at SP. I wasn't even aware SP had any until then.


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
  •