Menu hotkeys under Windows

Report any Hollywood bugs here
Post Reply
User avatar
jPV
Posts: 193
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Menu hotkeys under Windows

Post by jPV » Fri Nov 16, 2018 5:37 pm

I noticed that I can't get menu strip hotkeys work properly on Windows (10), while they do work perfectly fine on other platforms I've tried. Under windows some hotkeys just don't get triggered when pressing Ctrl+hotkey. Menu entries themselves do work if selected with the mouse.

Here's an example:

Code: Select all

MENU 1, {
    {"First menu", {
	{"test1", ID = "test1", Hotkey = "1"},
	{"test2", ID = "test2", Hotkey = "2"}}},
    {"Second menu", {
	{"test3", ID = "test3", Hotkey = "3"},
	{"test4", ID = "test4", Hotkey = "4"}}},
    {"Third menu", {
	{"test5", ID = "test5", Hotkey = "5"},
	{"test6", ID = "test6", Hotkey = "6"}}}
    }
@DISPLAY {Menu = 1}
NPrint("Try these hotkeys with the ctrl key: 1 2 3 4 5 6")
InstallEventHandler({OnMenuSelect=Function(msg) NPrint(msg.Action, msg.Item) EndFunction})
Repeat
   WaitEvent
Forever
When I run that under Windows and try to press ctrl-1, ctrl-2, etc, only 5 and 6 do work, 1-4 just don't trigger the event. If I remove the third menu, then items in the second menu do work. So it looks here that only the items in the last menu do work, but I think it's the case only with this certain example. I had another kind of menu structure, and there the working keys felt more random... didn't save it but can try to re-create it if needed.

User avatar
airsoftsoftwair
Posts: 2662
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Menu hotkeys under Windows

Post by airsoftsoftwair » Fri Nov 16, 2018 9:21 pm

Nice find, fixed!

Code: Select all

- Fix [Windows]: Menu hotkeys didn't always work correctly

User avatar
jPV
Posts: 193
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Menu hotkeys under Windows

Post by jPV » Sun Nov 18, 2018 11:28 am

BTW. Non-alphanumeric hotkeys don't seem to work under Windows either, like "+", "-", ".", "?" etc. Is that some limitation of Windows itself or something to do with Hollywood?

User avatar
airsoftsoftwair
Posts: 2662
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Menu hotkeys under Windows

Post by airsoftsoftwair » Tue Nov 20, 2018 6:36 pm

Mmh, I think anything else besides alphanumeric characters is currently pretty much undefined behaviour. I'll see if this can be fixed :)

User avatar
airsoftsoftwair
Posts: 2662
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Menu hotkeys under Windows

Post by airsoftsoftwair » Thu Dec 06, 2018 5:59 pm

Well, at least +-,. work now. Everything else is rather difficult to support so better stick with those :)

Code: Select all

- Fix [Win32]: +-., weren't working as menu shortcuts

User avatar
airsoftsoftwair
Posts: 2662
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Menu hotkeys under Windows

Post by airsoftsoftwair » Sat Dec 08, 2018 4:31 pm

Better fix implemented now. All characters should work as shortcuts now.

Code: Select all

- Fix [Win32]: Non-alphanumerical characters as menu shortcuts didn't work

Post Reply