Using AddKeyboardShortcut() to wait for any key

Just starting out? Need help? Post your questions and find answers here.
User avatar
Blue
Addict
Addict
Posts: 884
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Using AddKeyboardShortcut() to wait for any key

Post by Blue »

Is there a way to use AddKeyboardShortcut(#Window, Shortcut, Event) so that you get a Menu event for just any keyboard input ?

For instance, when using RemoveKeyboardShortcut(#Window, Shortcut), you can remove all shortcuts in one swoop with #PB_Shortcut_All. I figured there must be a way to do something similar with AddKeyboardShortcut()...
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Using AddKeyboardShortcut() to wait for any key

Post by Dude »

+1
User avatar
mk-soft
Always Here
Always Here
Posts: 5395
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Using AddKeyboardShortcut() to wait for any key

Post by mk-soft »

Unfortunately not possible, because Gadget with keyboard input does not pass the event.
It only works with a keyboard hook and a test on the active window.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Blue
Addict
Addict
Posts: 884
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Using AddKeyboardShortcut() to wait for any key

Post by Blue »

Thanks for the reply and explanation, mk-soft.
But isn't this kind of keyboard event generated by the window itself ? I don't see any gadget involved in adding the function to the source code. And since the window can react to a specific key press, why couldn't it react as well to just any key press? :idea:
Anyway, I'm sorry to discover that it does not exist :cry: ; it would be most useful, especially during the debugging phase of an application's development.
Maybe i ought to move this topic to the wishing well of the forum, that bottomless pit... :D
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
Post Reply