Generate german characters with keybd_event

  • Thread starter Thread starter Benjamin Lukner
  • Start date Start date
B

Benjamin Lukner

Hi!

How do I generate german umlauts (äöüß)? They're not part of the
VirtualKeys. I couldn't find any documentation on how to use ScanCodes
with keybd_event(). I tried MapVirtualKey(), but I got empty results for
any parameters I tried. keybd_event(0, i, iUpDown, 0) also produced only
empty events.

Paul Tobey suggested to simulate ALT+Ascii-Code-Sequence, but that
doesn't work on a Pocket PC.

The SIP on a german PPC produces strange events. The KeyData is the same
for several different characters. But the characters themselves are OK...

Does anybody know what code is behind that SIP? How does it work (what
functions does it use)...?


Kind regards,

Benjamin Lukner
 
For real honest-to-goodness characters, that is, not control characters, you
can use PostKeybdMessage() to send the characters, rather than the keys.
You might do something like this to simply send the ü character to the
currently-focused window:

UINT flag = KeyStateDownFlag;
UINT char = _T( 'ü' );

PostKeybdMessage( (HWND)-1, 0, flag, 1, &flag, &char );

Paul T.
 
Paul said:
For real honest-to-goodness characters, that is, not control characters, you
can use PostKeybdMessage() to send the characters, rather than the keys.

I hoped to be able to do it with keybd_event(), but I think I have to
use a select statement and both functions. The problem is that I need
the KeyDown and KeyUp events. These events transmit rubbish when using
PostKeybdMessage(). But the MS-SIP also transmits rubbish when clicking
on special characters, so I'd better don't care ;-)

Thanks,

Benjamin Lukner
 
I can't think of a great reason to want keydown and keyup events when you're
sending text. It makes sense for control characters, arrow keys, etc., but
regular characters not so much. My wedging code uses a combination of both
to send just about anything that you can represent in a string into the
input stream and it works very well.

Paul T.
 
Paul said:
I can't think of a great reason to want keydown and keyup events when you're
sending text. It makes sense for control characters, arrow keys, etc., but
regular characters not so much. My wedging code uses a combination of both
to send just about anything that you can represent in a string into the
input stream and it works very well.

That's what I meant when mentioning the select statement.
I don't need KeyUp/KeyDown for german characters. But I had not to
implement two functions, if it would work with keybd_event.

Cheers,

Benjamin Lukner
 
Back
Top