how to read a unicode charecter from key board

hi all

can anyone tell me how to read a unicode charecter from the key board?

Keyboards don’t do Unicode. They don’t do ANSI either. Keyboards report scancodes and then an upper layer, win32k.sys and the raw input thread, have a translation table (a keyboard layout DLL) which maps the scancode to a virtual key/character.

What are you trying to do? In kernel mode, you can know about any key being pressed, but processing the input is done in UM.

d

yes, actually we are working at user mode. and we are trying to build the application in UNICODE build. and we are using _gettchar to read the input charecter. we came to know from the msdn that getchar will convert multibyte character or a wide character according to whether stream is opened in text mode or binary mode. we change the mode to binary mode to get the unicode input, using _setmode(). still we are not able to convert the input charecter into a unicode charecter.
we are facing problems, when the input charecter is a japaneese charecter.

could you help us on this?

xxxxx@patni.com wrote:

yes, actually we are working at user mode. and we are trying to build the application in UNICODE build. and we are using _gettchar to read the input charecter. we came to know from the msdn that getchar will convert multibyte character or a wide character according to whether stream is opened in text mode or binary mode.

No, that’s not correct. Text vs binary mode is not related to multibyte
vs Unicode. Where did you read this? We should get it fixed.

getchar() always returns ANSI. getwchar() is the function for getting
Unicode.

we change the mode to binary mode to get the unicode input, using _setmode(). still we are not able to convert the input charecter into a unicode charecter.
we are facing problems, when the input charecter is a japaneese charecter.

As an alternative to getwchar(), you could use getchar() and then call
mbtowc() yourself to convert to Unicode.

could you help us on this?

This is not the correct list for this question. This list is for folks
writing kernel drivers.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.