NO

Author Topic: Menu keyboard shortcuts not recognized  (Read 7190 times)

PhilG57

  • Guest
Menu keyboard shortcuts not recognized
« on: February 24, 2007, 07:13:57 PM »
When using the alternate form of menu statements in my resouce file, during program execution I do not see the shortcut key identified with an underline.  For example, using:
BEGIN
CONTROL "&Com Port", IDC_STATIC, "Button", BS_GROUPBOX, 8, 20, 84,144

CONTROL "COM&1"
, IDC_COM!, "Button", BS_RADIOBUTTON, 16, 52, 64, 8
CONTROL "COM&2", etc.
CONTROL "COM&3", etc.
END

During program execution and display of the appropriate menu, I think I should see menu items like:
Com Port
COM1
COM2
etc.

I am not using nor loading keyboard accelerators.  This alternate form of resource statements is mentioned in Petzold p. 497; I have not tried the 'normal' form of resource statement.  Thanks in advance.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Menu keyboard shortcuts not recognized
« Reply #1 on: February 24, 2007, 11:42:52 PM »
Most likely not a bug, but a Windows "feature". I don't remember in which version of Windows it started (maybe Windows 2000), but check:

Windows "Screen Properties" -> "Apperance" -> "Effects", "Hide underlined letters until Alt is pressed" checkbox.

(This is for Windows XP; I'm not sure about the exact English names, since I'm running a *Swedish* version of Windows XP).
/Pelle

PhilG57

  • Guest
Menu keyboard shortcuts not recognized
« Reply #2 on: March 04, 2007, 05:33:21 PM »
I've tried my "alternate" script under W2K and XP with the same results.  I've also compiled a sample program from Petzold ("About2") which uses the "normal" form of the resource statement with similar results.  In all cases, the appropriate character on the menu item is not under-lined.

I did discover that pressing the "alt" key causes the menu item letter to be underlined as expected.  Now I just need to figure out how to cause the underlining to be the default.

Greg

  • Guest
Menu keyboard shortcuts not recognized
« Reply #3 on: March 05, 2007, 12:29:21 AM »
In the US English version of XP:

  "Control Panel" -> "Display" -> "Appearance" -> "Effects", "Hide underlined letters until Alt is pressed" checkbox.

ivanhv

  • Guest
Menu keyboard shortcuts not recognized
« Reply #4 on: March 10, 2007, 12:09:24 AM »
Try opening the calc (WND+R "Calc" ENTER)

Look at the menu

There are no underbars.

Press ALT (so the menu gets focused).

Look at the menu.

There are underbars.

That's, as Pelle said, a Windows feature. Others said how you can change the system preferences for changing this. Try not to fight against the feature from the code (not only you will fall down to a hell, but it's bad programming from the usability point of view, too)