Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic keyboard beep after keydown is handled (Read 6587 times)
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
keyboard beep after keydown is handled
Sep 24th, 2013 at 7:04pm
Print Post  
i'm handing keydown via the event sink, and all is well, except that there's an annoying keyboard beep occurring after every keypress. is there some way i'm missing to keep this from happening? thanks!
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: keyboard beep after keydown is handled
Reply #1 - Sep 24th, 2013 at 7:49pm
Print Post  
Smiley The flowchart control does not play any sounds. Check if something in your keydown handler isn't calling the Win32 Beep or MessageBeep functions. You might try using the debugger's Break at Function command to break on both of them as explained in http://stackoverflow.com/questions/3080624/debug-break-on-win32-api-functions, and see what's in the callstack at that point.
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: keyboard beep after keydown is handled
Reply #2 - Sep 24th, 2013 at 8:13pm
Print Post  
clever technique! definitely not something in local code (and a first pass at tracking messagebeep turned up nothing helpful) but knowing it's not part of the .com control is start. i'll keep digging.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: keyboard beep after keydown is handled
Reply #3 - Sep 25th, 2013 at 5:49am
Print Post  
According to http://social.msdn.microsoft.com/Forums/vstudio/en-US/ed5543dc-acc8-44ca-a704-c7..., if you are showing the flowchart in a dialog window and the dialog detects the keys too, it might be playing error beeps if it decides the keys are invalid, perhaps meaning there are no shortcut bindings for dialog controls to them.

You could also try handling the keys using PreTranslateMessage in the dialog itself rather than the flowchart, in case some other child control detects them and beeps:
http://stackoverflow.com/questions/4699148/why-doesnt-onkeydown-catch-key-events...
http://www.codeproject.com/Articles/1619/Keyboard-messages-accelerators-handling...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: keyboard beep after keydown is handled
Reply #4 - Sep 25th, 2013 at 3:18pm
Print Post  
Just saw this. Turns out that if I subclass the flowchart control such that it returns DLGC_WANTALLKEYS when receiving a WM_GETDLGCODE message, it no longer beeps. Since the com object is bound to a static, the static was basically just saying, "I don't want to handle keyboard input."
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint