PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SIP spacebar and Enter

Hi,

I have a problem, where the spacebar key is not recognized when pressed on the SIP (soft input panel) of my MFC WinCE program.

The OnChar method recieves all the characters on the
keyboard besides the spacebar. When the spacebar is
pressen, the OnChar method isn't called at all.

The Enter key just makes the application exit for some reason.

Does anyone know how to solve my problem?
In what class are you overriding OnChar? The framework is handling those messages before they get to you. You must have a Dialog based application, and CDialog is handling the Enter key and closing the app, which is the default behavior for a dialog.

A simple solution should be to override OnChar in your main Dialog class. If the message is VK_ENTER then just return, otherwise call CDialog::OnChar.

Dan East
Thanks for the comment, but it doesn't work.
It's derived from CStatic.
Sorry, in CDialog instead of just returning when you see VK_ENTER, try calling CWnd::OnChar(nChar, bRepCnt, nFlags).

Dan East
Thanks, but I don't think it solves the problem (and I tried it and it didn't).

The problem is, OnChar isn't even called when the spacebar is pressen on the sof input pannel. So it must generate a different kind of message (I suppose)?
The problem is I don't know what kind of message so I can't catch it.
Try handling OnKeyDown / OnKeyUp. Again, make sure you are doing this in your main dialog class.

Dan East
I apear to have fixed it.
Thank you!