How to convert input read from \Device\KeyboardClass0?

Hi everyone,

I just wondered how I can convert the input from KeyboardClass0 to something
meaningful? It has something to do with the keyboard layout DLLs, but which
macro/function needs to be called to convert input into a Unicode string
(for example)?

Cheers,

Oliver

You will only have KEYBOARD_INPUT_DATA structures, which contain the VK_xxx
key codes.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Oliver Schneider”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 07, 2004 8:39 PM
Subject: [ntdev] How to convert input read from \Device\KeyboardClass0?

> Hi everyone,
>
> I just wondered how I can convert the input from KeyboardClass0 to something
> meaningful? It has something to do with the keyboard layout DLLs, but which
> macro/function needs to be called to convert input into a Unicode string
> (for example)?
>
> Cheers,
>
> Oliver
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

VK_xxx key codes are not a 1:1 mappint to raw scan codes.
KEYBOARD_INPUT_DATA is reports raw scan codes. The raw codes goto
win32k and win32k uses the current keyboard layout DLL to map the codes
into the current character map.

Note that if you open \Device\KeyboardClass0 before win32k.sys you will
effectively stop input from that device reaching the system. Also, on
XP and beyond the device named \Device\KeyboardClass0 is probably the
terminal services redirected keyboard. You should use the keyboard
class interface GUID (GUID_DEVINTERFACE_KEYBOARD) and enumerate that
instead.

If you are creating a filter and intercepting the KEYBOARD_INPUT_DATAs
and not interfering with the win32k reads, then my concern about
stopping the input from reaching win32k.sys is not an issue. Also, you
don’t need to enumerate the device interface b/c you are already in the
stack.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, June 07, 2004 9:56 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to convert input read from
\Device\KeyboardClass0?

You will only have KEYBOARD_INPUT_DATA structures, which contain the
VK_xxx
key codes.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Oliver Schneider”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 07, 2004 8:39 PM
Subject: [ntdev] How to convert input read from \Device\KeyboardClass0?

> Hi everyone,
>
> I just wondered how I can convert the input from KeyboardClass0 to
something
> meaningful? It has something to do with the keyboard layout DLLs, but
which
> macro/function needs to be called to convert input into a Unicode
string
> (for example)?
>
> Cheers,
>
> Oliver
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com