[REBOL] Re: noob questions: keyboard access to buttons
From: Izkata::Comcast::net at: 21-Apr-2008 3:01
On Sun, 2008-04-20 at 13:37 -0600, Gregg Irwin wrote:
> Hi Doug,
> D> Assume I have this window (running on Windows XP)
> D> view layout [myfield1: field "data1" myfield2: field "data2" button "Do
> D> something" [dosomething] button "Quit" [quit]]
> D> I want to create keyboard access, so the user does not have to use a mouse.
> D> Is there a way to get focus to the buttons, so hitting 'enter' on the
> D> keyboard will activate a button?
> D> Is there a way to add the buttons to the tabbing order?
> No. Lack of a complete focus system, and keyboard support, is one of
> the biggest holes in VID. If you want to do this, you'll have to do a
> lot of work yourself. I'm not sure how RebGUI is on this count, but it
> might be better. Maybe a RebGUI user will respond.
Well, there's sort of a way to fake the "hitting enter" thing in VID:
view layout [
myfield1: field "data1"
myfield2: field "data2" [MyButton/action MyButton MyButton/text]
MyButton: button "Do something" [dosomething]
button "Quit" [quit]
Hitting Enter on the first field automatically moves to the next, and
hitting enter again would move back to the beginning of the list of
fields. The action associated with the second field gets triggered when
it loses focus.
The problem is that field actions get triggered *any* time the focus
leaves the field - so if the user clicks somewhere, or tries to tab out
of it, the action will still happen.