Closed
Bug 44676
Opened 26 years ago
Closed 25 years ago
Spacebar to trigger buttons should behave more like win32 native buttons
Categories
(Core :: XUL, defect, P3)
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: bugzilla, Assigned: bugzilla)
References
Details
Attachments
(2 files)
|
2.23 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.30 KB,
patch
|
Details | Diff | Splinter Review |
Build ID: 2000070608
When a button has the focus, you can press spacebar to "press" the button and
trigger it's default onclick action. This is also the case in other win32
apps, but standard behavior is that when the spacebar is down, the button goes
down (i.e. visually depresses), and when you then release the spacebar, the
button goes up (i.e. returns to it's normal, non-depressed state). This subtle
style effect would be nice to have and would keep consistency with win32. I'm
not sure if this is the same behavior in linux (perhaps depending on the window
manager) or mac, or even if spacebar triggers buttons in those platforms.
Comment 2•26 years ago
|
||
The button must go to :active when space is pressed. How do we do that? Any
ideas?
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•26 years ago
|
||
hmm..not sure...ben or john, any ideas?
Comment 4•26 years ago
|
||
Not making this train. mass-moving all evaughan non-nsbeta3+ bugs to Future
milestone
Target Milestone: --- → Future
Comment 5•26 years ago
|
||
Strictly speaking this applies to check boxes and radio buttons as well: holding
down space is equivalent to holding down the left mouse button.
And if you want to be really picky, the mouse takes precedence over the space
key - if both are down at once then the mouse hover rules apply.
| Assignee | ||
Comment 9•25 years ago
|
||
Comment 11•25 years ago
|
||
Did you confirm that this works okay with the HTML file picker control?
Specifically what happens when you type space in the textfield part of that
control?
| Assignee | ||
Comment 12•25 years ago
|
||
I can only test this on Windows at the moment, which uses the native file picker.
Comment 13•25 years ago
|
||
No, not the file picker dialog, the widget that shows up in html that is a
textfield and a button that are associated.
| Assignee | ||
Comment 14•25 years ago
|
||
Oh. Yeah, it works fine. (This is XUL only, btw...)
Comment 15•25 years ago
|
||
Okay, scc would point out that you should prefer NS_STATIC_CAST and friends
instead of straight C casts, but otherwise, it looks OK to me. r=saari
| Assignee | ||
Comment 16•25 years ago
|
||
Okay, will do. Thanks. cc'ing alec for sr
Comment 17•25 years ago
|
||
I don't want to sr= event stuff - it's just too scary for my shallow depth of
knowledge in that area, sorry :(
how about hyatt and/or saari?
| Assignee | ||
Comment 18•25 years ago
|
||
k. cc'ing hyatt for sr
Comment 19•25 years ago
|
||
You're putting the button into :hover on a keypress, which I don't know that you
can really get away with. You'll destroy the :hover feedback that the mouse is
supplying. It looks like you don't clear :hover either after stealing it away
from the mouse.
| Assignee | ||
Comment 20•25 years ago
|
||
Hyatt: Fixed point two in my tree (about not clearing :hover). I understand
point one, but I'm not quite sure what to do about it. How else can we achieve
the same effect? Any ideas? I can't imagine it causing any problems, but it
is indeed awkward.
| Assignee | ||
Comment 21•25 years ago
|
||
...The problem, of course, being that buttons, etc. only (correctly) have the
right style rules for :hover:active, not :active.
| Assignee | ||
Comment 22•25 years ago
|
||
| Assignee | ||
Comment 23•25 years ago
|
||
One last thing, it doesn't really destroy the mouse :hover feedback, although
this may actually be the problem (if you hold down spacebar while moving the
cursor over other widgets, the button will pop in and out as it passes in and
out of :hover...I was planning on discussing how to fix this with saari in a
separate bug after this, since it's the 1% case).
Anyways, I'd really like to see this fixed, so suggestions welcome.
Comment 24•25 years ago
|
||
I think it's good enough this way, since most of the time the user isn't moving
the mouse while they hit the keys.
sr=hyatt
| Assignee | ||
Comment 25•25 years ago
|
||
Fix checked in.
Thanks hyatt, sorry for all the spam from this tonight. New bug coming to
handle the cursor case.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 26•25 years ago
|
||
Just to be picky, the Win32 behaviour is to ignore the keyboard when the mouse
button is pressed, i.e. 'hold space, button down, release space, drag mouse out,
button up' does not trigger the button. If space has been held when you button
down, drag out and button up then the button reactivates. Not that the average
user uses the mouse and keyboard quite so simultaneously...
You need to log in
before you can comment on or make changes to this bug.
Description
•