simulating joystick, mouse and keyboard

I want to add virtual joystick, mouse and keyboard which my user mode application can control. After searching and reading on the web, I have modified to the vhidmini sample report descriptor to add the devices.

The devices are being added fine :).

Now I am stuck on the next step ie how do I communicate with these devices. vhidmini sample has been discussed a lot but after banging my head and searching for 2 days, still not clear what needs to be done. It will be great if somebody can give me an high level overview and based on that I can read and try it out.

wrote in message news:xxxxx@ntdev…
> I want to add virtual joystick, mouse and keyboard which my user mode
> application can control.

Sees like everybody is doing virtual input devices this days…

> Now I am stuck on the next step ie how do I communicate with these
> devices. vhidmini sample has been discussed a lot but after banging my
> head and searching for 2 days, still not clear what needs to be done. It
> will be great if somebody can give me an high level overview and based on
> that I can read and try it out.

(Almost) nothing needs to be done as it’s already done in the vhidmini
sample. The HID collection in the report descriptor has a feature item
dedicated for comunication. Your application should obtain a handle to this
collection and use HidD_GetFeature() to send stuff to it. You only implement
IOCTL_HID_GET_REPORT according to some protocol you define. Everything is
already done in the sample, including the user space application. You only
need to implement more IOCTL_HID_GET_REPORT stuff.

I find this HID business very confusing, so I wouldn’t do this because I
would have no idea how to debug if it didn’t work. I’d use a raw PDO or
create a control device.


Aram Hăvărneanu

So I should control code requests throught GetFeature and handle them in IOCTL_HID_GET_FEATURE.

Using HIDMINI_CONTROLCODE_Xxxx type of codes, I can know which device data is meant for and what should be the sent to that device.

It might be silly questions :), but how do I send this data to HID Joystick I created for example, i determined that I need to set the X-axis value to 0.5. How do I do that?