touchpad-handwriting
touchpad-handwriting copied to clipboard
Capture Windows Precision Touchpad raw input
Hi. I was able to capture Windows Precision Touchpad raw input here. Please checkout it out if you have any time.
Thanks for the info. I had also seen another project that tapped into the PTP HID events (don't remember the name), but I have not had the time to actually study it. Your project seems simpler (in a good way, though it currently lacks a licence file).
I can't say if I will ever get to trying it though, since I don't have a need for it now. Might do it if I am really bored one day.
SynapticsTouchPad::TouchPad
has a rather simple interface. If you already have C code which can generate a stream of touchpad events, the easiest way to get it work is probably to use IPC. One can make an alternative implementation of the TouchPad
class which takes events from a named pipe, and your C code can send the events through the named pipe.
I think a GUI application (its HWND
) is required in order to receive raw input from Windows. It would be great if we could just plug a "module" somewhere to use IPC.
I believe it is rather typical for programs without a front-facing UI to use a hidden window just for the message pump.
Thanks. I will try that later.
I am thinking of implementing the BlockInput
call while capturing the raw input. It was so annoying when the cursor reaches the bottom-right corner.
Can you use a low level mouse hook to disable mouse input? Better yet, implement it in a way such that it would automatically unblock if an external mouse is moved. Probably with a slight delay since you can't directly pair raw input events with the low level mouse hook.
Thanks. I just knew about Hooks. Never thought that there was something like hook
.
SynapticsTouchPad::TouchPad
has a rather simple interface. If you already have C code which can generate a stream of touchpad events, the easiest way to get it work is probably to use IPC. One can make an alternative implementation of theTouchPad
class which takes events from a named pipe, and your C code can send the events through the named pipe.
Just for practice I implemented an out-of-process touchpad handling using named pipe IPC and it appears to work OK-ish. The code is not very pretty though.
If you want to implement a client with the same protocol and plug it in, it should just work. Not sure if it would be simple in C (the named pipe APIs should be rather straightforward, not sure about non-blocking read on the main thread. You might want to use a worker thread).
Thanks. I will try to implement that client. IPC method sounds very promising to me.