Page 1 of 1
Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 2:00 am
by Tom
Hi, Roger.
Some of my customers complain about the Windows-"ping"-sound with accelerator keys/shortcuts using the "ALT" key. If there is a menu item or a pushbutton with something like "ACCELKEY xbeK_ALT_K", Windows plays the standard "ping" sound (event not recognized/handled). It looks like DC_XbpDialog misses a ShortCutHandler (xppw32\source\samples\solution\shortcut). This leads to a recognition of the key stroke, but Windows does not know about the event handled - and plays the sound, even if the event was handled correctly.
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 6:41 am
by rdonnay
I will look into this. Thanks.
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 6:58 am
by rdonnay
Tom -
How do I get the "ping" sound?
Code: Select all
FUNCTION Main()
LOCAL GetList[0]
@ 0,0 DCPUSHBUTTON CAPTION 'Test' SIZE 10,2 ACCELKEY xbeK_ALT_K ACTION {||Msgbox('test')}
DCREAD GUI FIT ADDBUTTONS
RETURN nil
PROC appsys ; return
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 7:05 am
by bwolfsohn
Roger, i'm going to guess that this may have to do with the german version of windows/xbase++, and not the US version.
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 7:10 am
by Tom
Try this:
Code: Select all
FUNCTION Main()
LOCAL GetList[0], oMenu, oFileMenu
DCMENUBAR oMenu
DCSUBMENU oFileMenu PROMPT "Test" PARENT oMenu
DCMENUITEM 'Test' PARENT oFileMenu ACTION {||DoNothing()} ACCELKEY xbeK_ALT_M
@ 0,0 DCPUSHBUTTON CAPTION 'Test' SIZE 10,2 ACCELKEY xbeK_ALT_K ACTION {||DoNothing()}
DCREAD GUI FIT ADDBUTTONS
RETURN nil
PROC appsys ; return
PROC DoNothing() ; return
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 7:14 am
by Tom
@Brian: This has nothing to do with german/US-versions. Roger's sample does not "ping" at my place. It starts pinging if the action connected does not create a windows output or starts a new thread.
Re: Windows-"ping" with accelerator keys
Posted: Thu Jun 14, 2012 11:20 am
by rdonnay
Ok, I see now. I still am not sure what I need to do to use the shortcut manager class.
It appears that I need to hook to the keyboard callback of the menu but the sample doesn't show anything about menus. Also, I'm not sure what function the shortcut manager is supposed to perform. Is all of this only to get rid of pings?
It appears that Microsoft added this as a feature, to let users know that an action occurred when they pressed the hot key.
Re: Windows-"ping" with accelerator keys
Posted: Fri Jun 15, 2012 12:45 am
by Tom
Hi, Roger.
If you find the time, take a look at the last message of this thread in the "german xbase forum":
http://www.xbaseforum.de/viewtopic.php? ... cutmanager
Re: Windows-"ping" with accelerator keys
Posted: Fri Jun 15, 2012 3:21 am
by c-tec
Hello,
also in a get with a popup if you press CTRL+ENTER instead of the button right of the get
regards
Rudolf