Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Treeview keyboard actions

Expand Messages
  • Satyam
    My keyboard is in Spanish. I understand you completely. Not much that can be done about it. At least my keyboard has the plus sign on the main keyboard
    Message 1 of 5 , Jul 29, 2009
    • 0 Attachment
      My keyboard is in Spanish. I understand you completely. Not much that
      can be done about it. At least my keyboard has the plus sign on the
      main keyboard accessible without shift, but still, there are other
      troublesome keys. The problem is not JavaScript but the DOM and that
      particular section responds to no standards. Anyway, the problem is
      with the hardware itself. If you assign different functions to the plus
      key with and without the shift key pressed and you are forced to press
      shift to access the character, then if all becomes messy. In the
      Spanish keyboard I have to use the Alt Gr key modifier for many more
      characters than the UK keyboard and it is a nightmare. The following
      characters are all accessible with Alt-Gr in the Spanish keyboard: { }
      [ ] @ # | \ . The Rich Text Editor uses Control and either of these: [
      | ] to do left, center and right justification. Control plus Alt-Gr
      doesn't work, so there goes the shortcut. Same with most software,
      browser or not, a real mess.

      Shift-+ does not expand dynamic trees because dynamic trees are usually
      large, that's why you've done them dynamic in the first place, in fact,
      they could be infinite if they loop around, which a static tree cannot.
      For safety, expandAll does not work on dynamic trees. In fact, it is
      not a keyboard thing, the expandAll method, which Shift-+ calls, won't
      work on dynamic trees. If your tree is safe to do a expandAll, then
      don't do it dynamic, just load it up front. Usually latency is a
      greater delay than the actual transfer of data, if the tree is based any
      reasonable amount of data that it can be expanded, it is probable faster
      to load it all up front than doing successive requests.

      Regarding documentation, please do file a ticket.

      Satyam

      Dave Howorth escribió:
      > I wrote:
      >
      >> Second, although the - [minus] key on both the main key and the
      >> numerical pad cause the subtree to collapse, only the + [plus] key on
      >> the numerical pad causes it to expand. The one on the main pad does
      >> not.
      >>
      >
      > Satyam wrote:
      >
      >> I couldn't see any difference in between response to the plus and minus
      >> keys.
      >>
      >
      > I wrote:
      >
      >> So clearly there's some difference between our systems. Maybe next week
      >> I might feel more motivated to find out what.
      >>
      >
      > I did some digging and learned some depressing facts. More than I wanted
      > to know about Javascript and keyboards. I now know that the keyboard
      > model in Javascript is fundamentally broken, with an inadequate design
      > plus all kinds of rampant incompatibilities between implementations :(
      >
      > And I know that the YUI treeview takes a straightforward approach to
      > keyboards, making use of the keyCode and shiftKey properties of the
      > keydown event, which unfortunately only fully works on certain keyboards.
      >
      > My keyboard is a UK layout
      > <http://en.wikipedia.org/wiki/Keyboard_layout#United_Kingdom>, which has
      > the main keyboard + above the = character like the US keyboard and many
      > other layouts. So the keyCode is 61 (=). AIUI, the way to detect
      > characters reliably is to use charCode, but then the browser
      > incompatibilities make life difficult.
      >
      > So I think the documentation for Treeview (see below) should refer
      > specifically to the plus and minus keys on the numeric pad, or risk
      > setting user expectations too high.
      >
      > I also discovered that SHIFT and PLUS does not expand my tree, since YUI
      > does not support that function for dynamically-created trees, although
      > it's not mentioned. That's more awkward in terms of user expectations,
      > since it means users will find some trees where it works and some where
      > it doesn't. But at least it should be documented.
      >
      > So
      >
      > "TreeView now responds to keys: arrow keys, home and end will move the
      > focus, plus and minus will expand and collapse a branch and coupled with
      > the Shift key they will expand or collapse the whole tree"
      >
      > becomes
      >
      > "TreeView now responds to keys: arrow keys, home and end will move the
      > focus, plus (on the numeric pad) and minus will expand and collapse a
      > branch and coupled with the Shift key they will expand (if the tree is
      > not dynamically created) or collapse the whole tree"
      >
      > Regards, Dave
      >
      > PS It's something of a misnomer that the YUI event 'enterKeyPressed' is
      > fired by the Javascript keyDown event rather than the keyPress event.
      > Since it is concerned with the actual key rather than the character, I
      > think it were better named 'enterKeyDown' for consistency.
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.392 / Virus Database: 270.13.31/2265 - Release Date: 07/26/09 17:59:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.