Re: normal buttons don't get down when pressed with SPACE or ENTER



> Antonio Campos <acampos@ceronet.com> writes:
> > But when you press space or enter over the button, the button doesn't
> > draw correctly. Currently, the button doesn't move, so the user doesn't
> > get the feeling of a pressed button with the keyboard.
> 
> Well in theory pressing the button should _do_ something the user can
> see :-) Such as close a dialog, etc.

	We should not make that assumption.  Where in the Gtk+ tutorials
does it say "...and if you attach a signal to the button, make sure it
does something that provides the user with visual feedback"?

> > This only happens with normal buttons, because toggle, check and radio
> > ones get drawn correctly when you use the keyboard over them.
> 
> Just because they change state, the mouse-related stuff doesn't show
> up with these widgets either.

	I think the problem is with the definition of "pressed" and
"released".  Havoc's comments state that "pressed" and "released" are
functions of the mouse, whereas Antonio is suggesting that "pressed" and
"released" are functions of the widget--so using the keyboard to "press"
the button should be no different from using the mouse to "press" the
(gtk)button.

> That's because they aren't pressed or released, because
> pressed/released means a mouse button was pressed/released (I think
> these two signals are useless and just confuse people, myself - maybe
> if you want something to happen while the button is held down, is the
> only use for them I can think of, and you can't hold a button down
> with the keyboard).

	Personally, I agree with Antonio and think that you *should* be
able to hold a (gtk)button down with the keyboard.

	Imagine a Gtk+-based golfing game where you have to hold a button
down for a certain length of time in order to "charge up" the amount of
power in your swing.  Unreal Tournament has a weapon (rocket launcher)
which you "load" by holding the key down for a certain amount of time,
Gimp uses held-down keys to modify actions; so this is a GUI element that
endusers would be familiar with.  They should get some visual feedback if
the onscreen element happens to be a button.

> I don't consider it a bug, maybe Owen/Tim would.

	I have not yet contributed to Gtk+, but as a "user" I'll voice my
opinion: it's a bug :).  One major target audience for Gnome is people
coming from the MS-Windows world, and MS-Windows lets them see their
(GUI)button presses.  (I do hope to contribute to Gtk+, and Gnome, in the
future)


--Derek





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]