[REBOL] Re: noob questions: keyboard access to buttons
From: gregg::pointillistic::com at: 20-Apr-2008 13:37
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.
D> Is there someway to code "Alt-Q" for Quit, with an underscored 'Q'?
It doesn't display hot-keys as underlined letters, and the ctrl key is
used more commonly in REBOL, as it would be for a shortcut key on a
menu. You can use the KEY style to catch keystrokes as well.
view layout [
button "Quit" #"^q" [unview] ; ctr;+q triggers button action
key #"^s" [alert "saving data"]
]
-- Gregg