Window mouse/keyboard filter driver ?

have an HID device that spews mouse messages. Under some circumstance those mouse message need transformed to Keyboard special keys. I need this to work for all versions of windows from 7 (or earlier) on.

I thought this would be a relatively simple filter driver. But I have not worked with Windows drivers in a long time

Reviewing documents suggests this is not as trivial as I thought.

Am I even pursuing the right approach ? Can this be done in userspace - apparently SendKeys() can inject keyboad commands. Can I trap the mouse in userspace ?

From what I see an HID filter driver is not an option until Windows 10 and highly discouraged.

I am finding it hard to beleive that a task that is maybe 20 lines of C inside an embedded device is impossible in windows.

Look at the moufiltr example. This will let you see all mouse input for the hid of your choice. You would then have the same driver filter the keyboard stack (copy the code from kbdfiltr) which allows you to inject keystrokes

Bent from my phone


From: xxxxx@lists.osr.com on behalf of xxxxx@dlasys.net
Sent: Thursday, January 12, 2017 3:03:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Window mouse/keyboard filter driver ?

have an HID device that spews mouse messages. Under some circumstance those mouse message need transformed to Keyboard special keys. I need this to work for all versions of windows from 7 (or earlier) on.

I thought this would be a relatively simple filter driver. But I have not worked with Windows drivers in a long time

Reviewing documents suggests this is not as trivial as I thought.

Am I even pursuing the right approach ? Can this be done in userspace - apparently SendKeys() can inject keyboad commands. Can I trap the mouse in userspace ?

From what I see an HID filter driver is not an option until Windows 10 and highly discouraged.

I am finding it hard to beleive that a task that is maybe 20 lines of C inside an embedded device is impossible in windows.


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

The usermode SendInput
https:
function can be used to synthesise keyboard and mouse events, and IIRC, you
should be able to hook system wide mouse events using the SendWindowsHookEx
function with a LowLevelMouseProc
https:
.

On Fri, Jan 13, 2017 at 12:03 AM, wrote:

> have an HID device that spews mouse messages. Under some circumstance
> those mouse message need transformed to Keyboard special keys. I need this
> to work for all versions of windows from 7 (or earlier) on.
>
> I thought this would be a relatively simple filter driver. But I have not
> worked with Windows drivers in a long time
>
> Reviewing documents suggests this is not as trivial as I thought.
>
> Am I even pursuing the right approach ? Can this be done in userspace -
> apparently SendKeys() can inject keyboad commands. Can I trap the mouse in
> userspace ?
>
> From what I see an HID filter driver is not an option until Windows 10 and
> highly discouraged.
>
> I am finding it hard to beleive that a task that is maybe 20 lines of C
> inside an embedded device is impossible in windows.
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:></https:></https:>

The limitation of SendInput is that it only works for the current session. You can’t use it for the security desktop. It might have IL restrictions too

Bent from my phone


From: xxxxx@lists.osr.com on behalf of Jonas Gulle
Sent: Friday, January 13, 2017 3:11:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Window mouse/keyboard filter driver ?

The usermode SendInputhttps: function can be used to synthesise keyboard and mouse events, and IIRC, you should be able to hook system wide mouse events using the SendWindowsHookEx function with a LowLevelMouseProchttps:.

On Fri, Jan 13, 2017 at 12:03 AM, > wrote:
have an HID device that spews mouse messages. Under some circumstance those mouse message need transformed to Keyboard special keys. I need this to work for all versions of windows from 7 (or earlier) on.

I thought this would be a relatively simple filter driver. But I have not worked with Windows drivers in a long time

Reviewing documents suggests this is not as trivial as I thought.

Am I even pursuing the right approach ? Can this be done in userspace - apparently SendKeys() can inject keyboad commands. Can I trap the mouse in userspace ?

From what I see an HID filter driver is not an option until Windows 10 and highly discouraged.

I am finding it hard to beleive that a task that is maybe 20 lines of C inside an embedded device is impossible in windows.


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:

— NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at</http:></http:></http:></https:></https:>