unbit / foohid

OSX IOKit driver for implementing virtual HID devices (joypads, keyboards, mices, ...) from userspace
MIT License
265 stars 36 forks source link

Unable to use buttons in the mouse example #6

Closed vigneshjathavara closed 7 years ago

vigneshjathavara commented 7 years ago

Im setting mouse.buttons = 4; that should work by pressing left button of the mouse. but nothing happens. The navigation using x and y is working properly but button clicks are not

vigneshjathavara commented 7 years ago

Actually it works but i think the 3 bits used are centerClick, RightClick, LeftClick

aldur commented 7 years ago

Hi, you have to issue 2 separate events in order for the click to be detected (press & release. For what regards the clicks: 0x01 is left, 0x02 is right and 0x04 is middle, so what you say it's correct.

Let me know if you need other info.

vigneshjathavara commented 7 years ago

Yes it works!! Thanks a lot :)