Hardware keypresses does not detectable by other programs
Disclaimer: I have zero C# knowledge
While I running the program, he somehow remove the capability to recognize key pressed, even physical , with other programs
For example, after running the program, This python standard code doesn't works:
if keyboard.is_pressed("del"):
os._exit(1)
'is_pressed' function doesn't care if it came from the physical keyboard nor injected
Yeah, there is a very big issue with the code (mine)
The code currently prevents any other program, which registered a Low level keyboard/mouse hook with SetWindowsHook prior to our program, to recieve any low level mouse/keyboard kernel events
To remedy this, the program not receiving any mouse/keyboard events, must remove their hooks, and then reinstate them (placing their hook procedure before our program in the hook chain)
tldr; the code in this repo should not be used as it is a bit misleading
The reason this happens is this line; https://github.com/Sadulisten/LowLevelMouseHook-Example/blob/master/LLMHREmover/Program.cs#L175
Dont know what I thought when I wrote this, but dereferencing the parameter lParam and passing it back as a pointer to callnexthook makes no sense
If it were to be done properly, it would simply pass the lParam, without doing any stupid stuff, right back into Callnexthook
I have "updated" the code in the repo. Now there shouldn't be any of the previous stupidities mentioned before, code is untested though, so it might not work but in theory it should (hopefully)
Have a good day/night
Thanks for the fast respond !
I succeeded to run your updated code, and the python code works now without a problem
But now its seems other programs can detect if it came from physical/other process
Tested with this repo detector example: https://github.com/errorc0de404/DetectMouseEvents
Wish I could contribute, I just monkey copy pasted =/
Can you try doing these two things;
- Start the detector first, and then this program; and report if it works
- Start this program first, and then the detector; and report if it works
If neither of these works, then I am afraid this no longer is a viable method for removing llmhf/llkhf flags unfortunately
Tried both situations, also as Administrator but he still detected
Thanks anyway !