Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird behavior with ALT-[key] Keyboard Shortcut for buttons

Status
Not open for further replies.

Statey603

Programmer
Nov 10, 2009
196
US
PB 11.0

It is me again with more weird behavior.

We have a screen with 2 Tabs. There are buttons on the screen for various operations - some common between Tabs and some unique.

At Runtime, Tab 1 keyboard shortcuts work as expected:
ALT-C: Closes screen, ALT-O: Opens detail screen, etc.
Tab 2 keyboard shortcuts do NOT work with the ALT key. they work with the single desginated key.
C: closes screen, O: Opens detail screen.

I cannot figure out why Tab 2 has lost the ALT part of the shortcut. I appreciate any information concerning where ALT is defined as part of the short-cut and/or how this works.

 
Apparently if a non-editable field has focus, then the ALT key is not needed for the shortcut//accelerator. I have confirmed that other screens that we have with buttons with accelerators exhibit this behavior if the focus is not on an editable field. The accelerators do work with ALT key and without (which I mistakenly said was not working in my original description above). The ALT is just not required if not on an editable field.

Refer to:
 
Here is more info......

This even happens in windows.
Go to Control Panel - Display - Screen Saver tab
- the [Settings], [Preview] & [Power] button accelerators work without holding down the ALT key.
 
NOTE:
The example above with the Windows XP Screen Saver Tab assumes that the screensaver is disabled so the dropdown is not selectable.


Another Windows screen that exhibits this accelerator behavior is Control Panel - Accessibility Options. The following button accelerators work without using the ALT key:
Settings 'S' (StickyKeys)
Settings 'e' (FilterKeys)
Settings 'n' (ToggleKeys)

 

as an add-on:

no need to assign any key at all for a button's shortcut when using &:
if you have text like "&Close" as the button text. alt+C will also work.

carefull with attributes 'default' (enter will execute button)
and 'cancel' attribute of button. (escape will execute button)

(I suppose you allready knew)

regards,
Miguel L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top