vinput
vinput copied to clipboard
How to use vmouse
Hi,
I've been trying to use the vmouse module (on a Jetson, kernel version approximately 4.0.0), and I cannot get the cursor to move (though the cursor does appear, and mouse button events seemed to work).
Can you confirm that it works for you, and point me in the right direction for how to debug this?
Thanks, Jonathan
Hi,
I confirm this is working for me. For the cursor to move, you need to provide the relative offset. For instance, here is the thing I tried:
$ insmod vinput_mod.ko $ insmod vmouse_mod.ko $ echo vmouse > /sys/class/vinput/export $ echo "100,0,0,0" > /dev/vinput0
The mouse should be moving right.
Let me how this works on your setup.
regards
Hi,
I just tried those instructions, and:
- A cursor appeared as soon as I exported the vmouse. This seemed good.
- When I echoed "100,0,0,0", the cursor didn't move.
However, when I connected a real mouse and moved the cursor over a button, I could make clicks happen by echoing "0,0,0,1" and "0,0,0,0".
The logs I got in dmesg were:
[ 34.543008] vinput: Loading virtual input driver [ 38.683366] vinput: registered new virtual input device 'vmouse' [ 45.520240] input: vmouse as /devices/virtual/vinput/vinput0/input4 [ 45.528998] vinput vinput0: Registered virtual input vmouse 0 [ 77.961265] usb 2-1: USB disconnect, device number 2 [ 83.864984] usb 2-1: new low-speed USB device number 3 using tegra-ehci [ 84.028386] input: USB Optical Mouse as /devices/soc0/7d008000.usb/usb2/2-1/2-1:1.0/0003:17EF:602E.0003/input/input5 [ 84.039888] hid-generic 0003:17EF:602E.0003: input: USB HID v1.11 Mouse [USB Optical Mouse] on usb-7d008000.usb-1/input0 [ 112.359747] usb 2-1: USB disconnect, device number 3
Where "usb-2-1: USB disconnect" and below correspond to when I unplugged the keyboard, plugged in a real mouse, moved the cursor, and disconnected it. dmesg looks fine to me. Would there be another place to look for errors other than dmesg?