Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Physical keypress

First post here. Hello!

I want to simulate physical keypresses (Windows). My application manage to synthesize keystrokes using classes like SendInput and Sendkeys but the keystrokes is registered as artificial by the os. I want the key presses made by my application to be identical to as when I press on my keyboard.

Any idea? Is this achievable using C#?
I don't believe such a thing is possible. Why does it being artificial matter? Please include more detail in your thread.

EDIT - Apparently it is with a driver as said below
You'd need to write some code that communicates with the physical HID keyboard device driver. If you don't have experience with driver development or ways of communicating with one, this could be challenging to you.

Here's a beginning for you, it's a wrapper in .NET which makes life easier to communicate with USB, Serial Port and Hid devices.

https : // christianfindlay . com /2021/01/31/device-net-4/
Bye bye LLMHF_INJECTED & LLMHF_LOWER_IL_INJECTED from MouseEvent/SendInput ;)
https://github.com/jasonpang/Interceptor
(Dec 19, 2021 11:10 PM)hazbot77 Wrote:  I don't believe such a thing is possible. Why does it being artificial matter? Please include more detail in your thread.

EDIT - Apparently it is with a driver as said below

(Dec 21, 2021 09:25 AM)oje28830 Wrote:  You'd need to write some code that communicates with the physical HID keyboard device driver. If you don't have experience with driver development or ways of communicating with one, this could be challenging to you.

Here's a beginning for you, it's a wrapper in .NET which makes life easier to communicate with USB, Serial Port and Hid devices.

(Dec 23, 2021 08:47 AM)Scapula™ Wrote:  Bye bye LLMHF_INJECTED & LLMHF_LOWER_IL_INJECTED from MouseEvent/SendInput ;)

Thanks. I have already (by spending many hours on Google searches) achieved my goal but I appreciate your answers.

Merry Christmas!
(Dec 24, 2021 06:37 AM)agoSwitch Wrote:  Thanks. I have already (by spending many hours on Google searches) achieved my goal but I appreciate your answers.

Merry Christmas!

How did you achieve your goal? share it here with everyone so people can learn.
Btw, with SendInput you can mimic a physical keyboard or mouse event. Look at the INPUT_HARDWARE field within the INPUT structure that you're passing to the api.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by InterGalacticMar 11, 2019 02:44 AM 6 275 Mar 11, 2019 02:44 AM
Last Post: InterGalactic
[.NET] by ChristmasNoobJan 28, 2019 03:21 PM 1 164 Jan 28, 2019 03:21 PM
Last Post: HeadHoncho
[C#] by RinqtMay 1, 2017 01:45 AM 5 212 May 1, 2017 01:45 AM
Last Post: mfqn