Closed Bug 356498 Opened 18 years ago Closed 18 years ago

[ally] arrow/pgUP/pgDown keys behavior for range

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: fixed1.8.0.12, fixed1.8.1.4)

Attachments

(1 file, 1 obsolete file)

This is spun off from bug 356342 (comments 3, 4 and 5). Current behavior of up/down arrow and pgUp/pgDown keys is to move slider to right/left. Though xul:scale (and java controls http://java.sun.com/products/jlf/ed1/dg/appendix.htm) acts in vice versa.
That's how Windows defines keyboard behavior for slider (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc/html/ATG_KeyboardShortcuts.asp): Arrow keys Move the slider to the next value. The direction can be reversed by selecting the slider control style LBS_DOWNISLEFT. PAGE UP and DOWN Move the slider to next value in specified incremental amount. The direction can be reversed by selecting the slider control style LBS_DOWNISLEFT.
GNOME 2.2 Desktop Accessibility Guide defines the next behavior (http://docs.sun.com/app/docs/doc/817-1972/6mhlsbe8h?a=view): left arrow or up arrow Move the slider left or up by a small amount. right arrow or down arrow Move the slider right or down by a small amount. Page Up Move the slider left or up a large amount. Page Down Move the slider right or down a small amount.
Also there is MS document (http://www.bilbo.com/ms_short.html) that says: Sliders appear as an indicator on a vertical or horizontal gauge. The slider both displays and sets a value from a continuous range, such as speed, brightness, or volume. Use TAB or the appropriate access key to move the focus to the slider. Keys: RIGHT ARROW or DOWN ARROW Action: Selects the next higher setting. Keys: LEFT ARROW or UP ARROW Action: Selects the next lower setting. Keys: HOME or END Action: Selects the lowest or highest setting. Keys: PAGE DOWN Action: Selects a somewhat lower or higher setting depending on the application. (This is the equivalent of pressing an ARROW key many times.) Keys: PAGE UP Action: Moves in the reverse of the PAGE DOWN.
(In reply to comment #1) > That's how Windows defines keyboard behavior for slider > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc/html/ATG_KeyboardShortcuts.asp): > > Arrow keys > Move the slider to the next value. The direction can be reversed by selecting > the slider control style LBS_DOWNISLEFT. > > PAGE UP and DOWN > Move the slider to next value in specified incremental amount. The direction > can be reversed by selecting the slider control style LBS_DOWNISLEFT. > MSDN says http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/trackbar/styles.asp TBS_DOWNISLEFT By default, the trackbar control uses down equal to right and up equal to left. Use the TBS_DOWNISLEFT style to reverse the default, making down equal left and up equal right.
Attached patch patch (obsolete) (deleted) — Splinter Review
Assignee: xforms → surkov.alexander
Status: NEW → ASSIGNED
Attachment #242324 - Flags: review?(aaronr)
Comment on attachment 242324 [details] [diff] [review] patch Also I changed behavior of pgUp/pgDown with http://java.sun.com/products/jlf/ed1/dg/appendix.htm correspondence (value increment/decrement approximately on 20% of scale). Since other docs say nothing concrete.
Attachment #242324 - Flags: review?(Olli.Pettay)
*** Bug 356499 has been marked as a duplicate of this bug. ***
Comment on attachment 242324 [details] [diff] [review] patch >Index: extensions/xforms/resources/content/widgets-xhtml.xml >=================================================================== >RCS file: /cvsroot/mozilla/extensions/xforms/resources/content/widgets-xhtml.xml,v >retrieving revision 1.10 >diff -u -8 -p -r1.10 widgets-xhtml.xml >--- extensions/xforms/resources/content/widgets-xhtml.xml 13 Oct 2006 00:53:28 -0000 1.10 >+++ extensions/xforms/resources/content/widgets-xhtml.xml 15 Oct 2006 14:20:14 -0000 >@@ -694,28 +694,32 @@ > this.ownerDocument.addEventListener("mouseup", handler, true); > ]]> > </handler> > > <handler event="keypress"> > nsIEvent = Components.interfaces.nsIDOMKeyEvent; > switch (event.keyCode) { > case nsIEvent.DOM_VK_RIGHT: >- case nsIEvent.DOM_VK_UP: >+ case nsIEvent.DOM_VK_DOWN: > this.value += this.step; > break; > case nsIEvent.DOM_VK_LEFT: >- case nsIEvent.DOM_VK_DOWN: >+ case nsIEvent.DOM_VK_UP: > this.value -= this.step; > break; >- case nsIEvent.DOM_VK_PAGE_UP: >- this.value += this.step * 2; >- break; > case nsIEvent.DOM_VK_PAGE_DOWN: >- this.value -= this.step * 2; >+ var delta = >+ parseInt((this.max - this.min) / 5 / this.step) * this.step; >+ this.value += delta ? delta : this.step; >+ break; >+ case nsIEvent.DOM_VK_PAGE_UP: >+ var delta = >+ parseInt((this.max - this.min) / 5 / this.step) * this.step; >+ this.value -= delta ? delta : this.step; > break; You should probably comment why you are using parseInt((this.max - this.min) / 5 / this.step) * this.step (to ensure delta is at least as large as step and no more than 20% of the selectable value). Your research is spot on and this should be our default since it is the default for so many other platforms. But it is still odd to hit the up arrow key and see the value decrease. It would be nice if we could think of a CSS style that we could use to reverse this if someone wanted that behavior. That'd be better than forcing the user to make a custom control. Oh, well. r=me
Attachment #242324 - Flags: review?(aaronr) → review+
Attached patch patch2 (deleted) — Splinter Review
Attachment #242324 - Attachment is obsolete: true
Attachment #243747 - Flags: review?(Olli.Pettay)
Attachment #242324 - Flags: review?(Olli.Pettay)
I filed bug 358315 to discuss ability to modify range key behavior.
Attachment #243747 - Flags: review?(Olli.Pettay) → review+
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
checked into 1.8 branch on 2007-04-12 checked into 1.8.0 branch on 2007-04-16
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: