Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Better keyboard-driven navigation, any?

by blazar (Canon)
on Jul 22, 2008 at 09:47 UTC ( #699245=monkdiscuss: print w/ replies, xml ) Need Help??

Due to serious health problems, I can now only spend a limited amount of time sitting on a chair in front of the keyboard of my pc, which is the only way I can write properly and fast like I'm used to. I also have to spend much time in bed: fortunately I managed to intelligently divide my "work" selecting stuff to read there on an Eee a few friends of mine brought me as a much appreciated gift - no matter what, writing is too hard but for brief notes. (So don't suggest any technique, please: I've tried everything!) All in all, this setup is very satisfactory, and the "reading sessions" include our beloved PM, comprehensive of voting, occasional considering (now this is what I call a brief note) and such stuff. However:

  • I've never really been a mouse enthusiast;
  • I've never really felt at ease with mousepads: which is the reason why I have a proper cordless mouse for my other portable pc, but it would be pointless for the Eee used laying in bed...

So, I wonder whether a better keyboard-driven navigation support for PM could be provided, in a way similar to that of, say, Google Reader: this is not the usual "make PM more 2.0 and ajaxy rant" since it is my understanding (which admittedly may be wrong) that much, if not all, of such functionality can be implemented with standard html attributes. Otherwise, probably a Greasemonkey script would do... but unfortunately that's beyond my capabilities. (And probably I've never felt the desire to learn js as much as now!)

What I was thinking of is much along the lines of: go to next and previous post, go to parent post, vote ++ or --, etc.

Before somebody points out currently available tricks, and possibly the "caret navigation" mode of FF, please let me tell you that I know both, and in fact I "survive" decently. Yet, I'm sure something better (in the terms above) could be done.

If you can't understand the incipit, then please check the IPB Campaign.

Comment on Better keyboard-driven navigation, any?
Download Code
Replies are listed 'Best First'.
Re: Better keyboard-driven navigation, any?
by Corion (Pope) on Jul 22, 2008 at 10:34 UTC

    I looked into adding keyboard shortcuts to PM, but the main problem was that these shortcuts conflicted with browser-specific shortcuts. The only shortcut keys possibly available seem to be the digits 0 to 9.

    I haven't investigated if it is possible to add keyboard shortcuts by using JavaScript. If that's possible, then it would be possible to have a set of prepared hotkey-adders depending on the browser and language the user uses.

    The one site I'm aware of which uses hotkeys ( uses Alt-1 etc. as hotkeys, so I assume there is no better cross-browser, cross-language way.

    If somebody comes up with sensible mappings for the numbers and items they'd like to have alt keys for, these are very welcome if only as starting points for those who have the JavaScript ability but lack the keyboard usage.

      The access key shortcut in FF3 on linux is Alt-Shift-KEY (see Access key for info about other browsers), and this is configurable in the about:config keys ui.key.*, (see the mozilla docs for more), so there should be no conflict with browser-specific shortcuts.

      Adding access keys is as simple as adding accesskey="$char" (for instance accesskey="Y" or accesskey="&")on any of these elements: A, AREA, BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA.

      Update Added example with an entity as suggested by ysth

        Thank you for pointing out that recent versions of FireFox allow one to change the quite stupid default of having "access" keys conflict with the "menu" access navigation (Alt) that I use very frequently (Win32). I find it funny (in a sad way) that these "ui" settings have such an impressively bad UI (you have to read a separate document to find that the cryptic integer values can be looked up on yet another page where they are in hex so you have to convert the hex to decimal and then type it in).

        My personal CSS puts red striped borders around "access key" navigation items just so I'm likely to notice them since they mostly serve to trip up my normal keyboard navigation techniques (so I'm certainly not a fan of their use so far).

        I wish I knew a similar trick for IE as I still use IE for PerlMonks even though I use FireFox for most other surfing (IE has key features that make it much nicer for surfing PerlMonks for me than FF, though FF 3 finally caught up on soft hyphen support after a decade of IE following the standard so that is one less key PerlMonks feature once FF 3 stabilizes).

        I don't see how your suggested navigation features fit PerlMonks. What is "next post"? You must be navigating via some more specific scheme that you don't explain for "next post" to make sense in your mind. There is no general concept of "next post" at PerlMonks so offering such a navigation option so prominently would most likely just confuse a large fraction of monks who don't or just currently aren't reading PerlMonks in the manner you are assuming.

        "Vote ++"? Most places at PerlMonks present more than one node to vote on so a "Vote ++" navigation doesn't make much sense to me.

        Perhaps you are thinking of scrolling within a thread, but I don't think access keys can be used that way (without doing a lot of JavaScript...).

        For navigating between voting buttons, I've found that several browsers already have decent keyboard navigation for that. The voting buttons are often "adjacent" form elements so "go to next form input control" (etc.) often works well for selecting vote buttons.

        I have used Opera and it does define some nice keyboard navigation shortcuts. So I encourage you to try it. You can also configure FireFox to "search when you type" which makes it fast to jump to navigation links via a keyboard.

        So, your suggestions for navigation keys reinforces my impression that for them to be useful, people need to be able to customize them (there are only so many keys and there are lots of ways to navigate PerlMonks).

        I also think that, with browser defaults mostly stupid with regard to access keys, it is best to have few if any access keys by default (such as only numeric ones, as Corion mentioned). Users who have made the effort to change the stupid defaults should be allowed to make the effort to define where they want access keys (I am disappointed that this isn't just natively supported in browsers -- part of the point of browsers and HTML was supposed to be to give the client control over presentation and navigation, despite so many web "designers" seemingly thinking nearly the opposite these days).

        Perhaps the best next step would be to look for places where you want an accesss key and see if the HTML makes it easy or hard to use JavaScript to attach such for your own use. Suggesting specific things like adding a specific id="..." to a specific navigation point would allow such customization to become easier.

        - tye        

      I haven't investigated if it is possible to add keyboard shortcuts by using JavaScript. If that's possible, then it would be possible to have a set of prepared hotkey-adders depending on the browser and language the user uses.

      I personally believe... err, no: I'm quite sure, a priori, that it's possible. They do every sort of freaking thing with JS! ;) But more precisely, I suspect that at least some amount of JS would be required to go beyond the bare functionality of the accesskey attribute: AIUI it only applies to some elements to the effect of simulating, say, a click on them; which is fine: the most notable example being the activation of a link or the selection of a checkbox. But one may want the pressing of a hotkey to be associated with e.g. the appropriate positioning of a box (a div) or somesuch, as in the examples I mention hereafter.

      The one site I'm aware of which uses hotkeys ( uses Alt-1 etc. as hotkeys, so I assume there is no better cross-browser, cross-language way.

      You should really try the aforementioned GR: I used too to read it mostly with the mouse. (Incidentally I think that amongst the many fundamentally useless "innovations" of modern popular pc machinery, one of the few actually useful ones is the mouse wheel.) But then I had that bed-Eee-mousepad difficulties and I started using keyboad shortcuts: you have e.g. "j" and "k" for next and previous article respectively, and "v" to open an article in a separate window/tab. If you're in a collapsed view, articles get open in sequence and positioned at the top of the view window... it's much like a specific client running on your computer. (As of the OP, I'm not asking PM that much...) I don't know how much of that is portable, but I'm confident that hardly can Google have made it incompatible with most major browsers...

      If you can't understand the incipit, then please check the IPB Campaign.
      I looked into adding keyboard shortcuts to PM, but the main problem was that these shortcuts conflicted with browser-specific shortcuts. The only shortcut keys possibly available seem to be the digits 0 to 9.

      No need to use keys with modifiers, so no conflict. The only thing one must be caring of is turning off the document.onkeypress callback whenever a text entry field or textarea gets focus -as far as javascript is involved,that is.

      Simple paging keys, say h,j,k,l and then some for sections, would do.

      update: I've put a prototype on my scratchpad. I know you have more JS fu than I and would appreciate a review :)


      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

        If Opera key binding flexibility is not enticing enough, there is also a "Vimperator" plug-in for Firefox (to get vi-like key bindings). Modifier keys being eaten by Gtk and/or Firefox (GNU/Linux) UI did not let me enjoy the plug-in late last year.

        Often I find myself failing to get the effect of my Opera (home) key bindings in Firefox (work). Of course.

        (If I am complaining, perhaps I should try once more to customize the installed version of Opera at work ... mmm ... I see, installation is broken):

Re: Better keyboard-driven navigation, any?
by moritz (Cardinal) on Jul 22, 2008 at 10:21 UTC
    Just a small remark: you don't need greasemonkey to inject javascript into perlmonks, the free nodelet can do it just fine (and it's browser independent).

    That said, I'm not too familiar with javascript either, and would welcome it if somebody implemented it and shared his/her code.

      I personally believe that since I have both the free nodelet enabled and GM installed, any would do: "we" are only missing the actual scripts. But then of course I cannot pop up and say to some knoledgeable one: "hey, just concoct them up for me!" (But if anyone takes care of doing so, then please /msg me...)

      Re your suggestion (via /msg) about Hit-a-Hint, I'll repeat for the benefit of others what I privately replied to you: namely, that I can see some negative recensions about it in terms of documentation -but that I can live with, since AIUI with some fiddling and customization it can be bent to your desires anyway: it's only a matter of patience- but most importantly that it's not going to work for me since I'm now happily on FF3 and it's supported up to 2.0. (Since I'm obviously not only on PM, I'm all interested in better keyboard navigability, and I'll continue to give a peek to the project page every now and again: it has some feeds but unfortunately none of them seems for announcements, so I'm not subscribing them...)

      If you can't understand the incipit, then please check the IPB Campaign.
Re: Better keyboard-driven navigation, any?
by Anonymous Monk on Jul 22, 2008 at 11:42 UTC

    Just use Opera. It has always been fully navigable by keyboard. Shortcuts are fully configurable. If you want, you can use single key shortcuts. There are shortcuts for moving between headings and links, for focussing forms and the page proper, find-as-you-type for links and full page text, and spatial navigation. If you get tired and your mobility required for the keyboard degrades, use the built-in voice interface.

    Switch now. This requires no messing with Perlmonks or Javascript. Your gain is immediate, you need not wait for someone to implement improvements. You make all of the Web more usable for yourself, not only this site.

      I personally believe that your keen plea in favour of Opera nearly resembles an ad: that's not a problem for me, and I'm sure it has its advantages. OTOH I'm not the kind of guy that takes a browser as a religion (I make fun of those who make up conflicting camps in a IE-FF flame) but one's best tool is the one she's already used to. And FF is mine. I'm at ease with it for quite about everything but possibly these recent difficulties with keyboard navigation. Not to mention that I had tried Opera some years ago, and I wasn't that enthusiast about it: I may retry it now, for fun. But I'm not leaving FF and the useful plugins (and some subtle customization) that make my experience of it even better...

      If you can't understand the incipit, then please check the IPB Campaign.
        I have a feeling the reason Opera has better keyboard support is due to its popularity on cell phones. Of course, as you point out that doesn't make up for the practically guaranteed lock-in of FF extensions! :-)
Re: Better keyboard-driven navigation, any?
by Gavin (Chancellor) on Jul 22, 2008 at 16:24 UTC

    I too do not like using a mouse and find it very tiring over long periods especially when surfing or using Photoshop or Dreamweaver.

    I now use a Trackball I have both Kensington and Logitech.

    Once I got used to them and it did take a while I find they are much easier to use for long periods.

    The beauty of them for me is that I do not have to move my arm I can control non keyboard functions with two fingers and my thumb.

      I've been using a trackball for many years now and the only drawback that I find is that the muscles in my upper arm can get a bit sore if I'm using the mouse for long periods of time ( read: gaming ). That would be my only concern for blazar's situation.

      Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

      I would love to change the world, but they won't give me the source code

        [...] if I'm using the mouse for long periods of time ( read: gaming ).

        I personally believe I'll leave that kinda problems to some monk who's far more expert than me! I'm at most playing some arcade every now and again. (Read: some incarnation of Tetris, 99% of the time. Although to be completely fair I'm having some frenzy these days for a tiny little game called Erix which used to come preinstalled in some Sony Ericsson mobile phones and of which I found an "improved" Java version: it can be considered as loosely based on the concept of the classic Snake game.)

        That would be my only concern for blazar's situation.

        Well, not only: as I explained in my last post on this subject, even a "better" tracking mechanism, for some acceptation of "better," would be by far suboptimal. Best of all would be to hold the "device" i.e. namely the Eee with both my hands, and interact with it "only" through the keyboard. Even with a trackball by the side of my bed, it would be annoying to have to reach it with a hand, and which one, given that I continuously change position? Well, sort of...

        If you can't understand the incipit, then please check the IPB Campaign.
      I now use a Trackball I have both Kensington and Logitech.

      I personally believe that they're not very popular in Italy: I've seen them in shops but never met or heard anyone actually using or having used one. It was much more a matter of tracking mechansim vs keyboard, than some other (possibly better) tracking mechanism, however you got me intrigued: certainly the "not moving arm" bit is obvious once somebody makes you notice it, but one probably can't value the advantage without thinking of it a little bit, and possibly trying. Maybe one day I'll do!

      If you can't understand the incipit, then please check the IPB Campaign.

        "I personally believe that they're not very popular in Italy:"


        I donít think trackballs are very popular in the UK either, but I donít know what I would do without mine now.

        To start with I did find that my fingers went into a cramp after a couple of hours, but after a quick break and a rub I could resume again, after a couple of weeks I found that I could work for much longer without discomfort, and now brain tiredness stops me before physical discomfort.

        Logitech make a Trackman which is cordless and has scrolling and other customisable buttons, I think this would be ideal for you.

        People told me to start with that trackballs are ok but are not so useful for drawing (if you donít have a graphics tablet). Again I found the trackball difficult to use for graphics, but very quickly I found that it was easier for me to draw complex shapes, for example this. drawing was done for a project using Freehand and Photoshop as was this

        I have a small Home Cinema which I can control with a trackball and Virtual Keyboard only using the keyboard when necessary.

        In the UK we have a great many resources for disability aids, both from local authorities and the private sector for example this organisation lists both software and hardware solutions including trackballs of various styles.

        Iím sure Italy is no different, try contacting your local Social Services Disability section, often these aids can be had on approval for suitability before buying.


        Trackballs never really did it for me, though it's been over a decade since I last touched one. I know I would have to go through a lot of pain just to get my hand muscles, etc. used to a trackball. But beyond that, I think it would be hard mentally to make the transition from mouse to trackball. I'm so used to using a mouse that it would feel very awkward for a very, very long time. Not to mention that there are things a mouse is clearly better at, such as gaming (especially First Person Shooters).

        Though with you being more of a keyboard person you might find a trackball more agreeable. If you want to give one a try though make sure you spend the extra money to get a really good one -- I don't think a cheap one would be a good test.

Re: Better keyboard-driven navigation, any?
by davies (Vicar) on Jul 22, 2008 at 14:26 UTC
    If you can bring yourself to use Losedows, I heartily recommend Keytext. Almost every key (I haven't tried system calls like {Ctrl Alt Delete}) is configurable, overriding individual settings (but bypassable if you wish). I think it's droolsomely lovely. It's saved me weeks. I'd be even more biased if I got a commission!


    John Davies

      I personally believe you may be surprised to discover that since about a pair of years I'm mostly albeit not exclusively a Windows-Kinda-guy: not without some guilt, but that's irrelevant here. Now, let me tell you that it's an interesting suggestion, and a program that I'm probably giving a look at (I've read the description - of course I don't like that it's commercial) but... to be fair I can't see it as the solution I wanted to my actual problem, which in turn isn't even that much of a problem. Except that I would like some... better keyboard-driven navigation means for PM.

      If you can't understand the incipit, then please check the IPB Campaign.
Re: Better keyboard-driven navigation, any?
by bart (Canon) on Jul 24, 2008 at 15:41 UTC
    On Firefox, I rely on "find as you type", with "'" if looking for a link (for example, type "'repl" to jump to the next "reply" link, and press enter to follow it), and nothing or "/" if looking for plain text in the page; or just tab to move between links (shift+tab if moving backwards).

    That's all I need.

      Those are exactly the tools I use too, and perhaps I must have sound more melodramatic than I actually am, for I can actually survive with the current means but I was under the impression that something better could be done and indeed I'm now trying shmem's new trickeries: experimental evidence is that however alpha can they be considered, they already provide a much enhanced experience at keyboard driven navigation, and precisely of the kind I cherished - if they can be put to completion, then I'm sure that at least as I am concerned, for one, they will result in a more efficient way to achieve the same tasks. I'm going to sleep now, but I'll post tomorrow a review in my scratchpad with the first impressions of use.

      If you can't understand the incipit, then please check the IPB Campaign.
        I won't say I expected you not to know about these tricks already, especially in your condition, where knowing these things matters more...

        I just added them to the thread to paint a more complete picture, as nobody had apparently mentioned them yet.

Re: Better keyboard-driven navigation, any?
by Erez (Curate) on Jul 22, 2008 at 16:16 UTC

    I've never really been a mouse enthusiast;

    Why not? Especially since it allows you to read the site without much of a hassle.

    Stop saying 'script'. Stop saying 'line-noise'.
    We have nothing to lose but our metaphors.

      I personally believe that "to each its own" is still a valid principle: and I generally feel more at ease with a keyboard with 100 or so keys than with a mouse with three for many tasks, of which browsing "the site" is only one out of many. Perhaps this was not clear from the start, and I apologize. The exact reason why I cannot tell, or perhaps it would be too long and irrelevant here: anyway, I'm not that extremely keyboard-centric as a ratpoison user, but I find that people tend to overuse the mouse making their own lives more difficult than necessary; for one thing is "without much of a hassle" and one thing is "efficiently" and... moving back and forth from the rodents, and clicking on menus and so on often doesn't make for the latter. No way!

      If you can't understand the incipit, then please check the IPB Campaign.
Re: Better keyboard-driven navigation, any?
by Zen (Deacon) on Jul 23, 2008 at 13:46 UTC
    I think you're missing the point. Blazar has stated he wants hotkeys via js on pm: not hardware, not another browser, or anything else that might work but taste bad.

      I personally believe that it's very kind of you to pinpoint that: because that's it! But at the same time I also feel like reassuring everybody else who's taking part to the thread that I took no offense for the OT discussions, which in fact turned out to be mostly interesting: and that's the reason why I'm also replying explicitly to you rather than /msg'ing.

      If you can't understand the incipit, then please check the IPB Campaign.
Re: Better keyboard-driven navigation, any?
by Argel (Prior) on Jul 23, 2008 at 21:05 UTC
    Okay, now you have me curious -- exactly what kind of keyboard are you using right now? A cheapie? Or perhaps a really expensive one from Logitech?

      Err, well... I have:

      1. a 15 yo keyboard for my desktop: if you ask me, it's nearly perfect. Again, I'm not that kind of "extreme" hacker who cherishes HHKBs, but let's say that on the spectrum having such beasts on the one hand and M$, Logitech and other "smart" keyboards on the other one, my tastes are much shifted towards the former. (I dont' like "fancy" buttons, and too many of them, in general.) To be fair, I've used at work an equally old (more or less) Model M keyboard which I must say, was far superior as far as tactile sensation is concerned;
      2. the keyboard of my Toshiba laptop, which is the one I've used most and often exclusively the last two years, and I'm now comfortable with;
      3. the keyboard of the Eee: I'm not making a review now, but I'll say it's fine and all as far as I'm concerned. Of course, due to its size, some keys had to be implemented by means of an Fn modifier; precisely: <, >, PagUp, PagDn, Home, End, plus the numeric keypad (which I'm never using anyway but for ALT+NUM insertions) as on most (all?) portable PCs. Since I tend to use these keys quite often, it is slightly annoying especially in the position(s) I frequently described in this thread, that is lying in bed, for the Fn modifier is on the left and the modifiable keys -but the first two- on the right, which forces me to use both hands to press one of them. Even more annoying is >, which requires Fn+Shift+z, and they're all adiacent each other. Perhaps, they should have put > on x instead.
      If you can't understand the incipit, then please check the IPB Campaign.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://699245]
Approved by moritz
Front-paged by grinder
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2015-11-30 07:19 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (763 votes), past polls