Page 1 of 1

mouse button information

Posted: Tue Jan 31, 2012 8:18 am
by misoct
Dear All

I am grateful to you if you told me how to insert the mouse Information to controll (right,lift and middle buttons) using the first byte described in the attached article and flowcode example
http://www.matrixmultimedia.com/resourc ... ontrol.pdf
thanks
tharowat

Re: mouse button information

Posted: Tue Jan 31, 2012 10:25 am
by Steve
I believe the button data is contained in the first byte of the data sent. You may need to experiment to see which bits of this byte represent which button.

Re: mouse button information

Posted: Tue Jan 31, 2012 10:47 am
by JonnyW
Hi. Typically on Windows and other similar systems, left is bit 0, right is bit 1 and middle is bit 2. I do not know about the scroll wheel (if present) though.

Jonny

Re: mouse button information

Posted: Tue Jan 31, 2012 10:48 am
by misoct
Hi Steve
thank you for quick reply
indeed I did the trials to dedect the bit by inserting input macro components in the flochart and push button in hardware also ,but there is no postive results
I want to know how to distigushe between button info.inside the flowcode program
thanks
tharowat

Re: mouse button information

Posted: Tue Jan 31, 2012 1:00 pm
by Steve
I've just played around with the USB_Sketch program and I can confirm that the bits of the first data byte are as follows:

bit 0 = left button
bit 1 = right button
bit 2 - middle button

Re: mouse button information

Posted: Tue Jan 31, 2012 11:53 pm
by misoct
Hi Steve
Here I worked on to add the information mouse buttons inside flowcode USB_Sketch_mod.fcf I hope to be right as i understand your explain
thanks
tharowat

Re: mouse button information

Posted: Tue Feb 21, 2012 9:34 am
by Steve
You would need to do something like the following, assuming "left", "right" and "middle" are variables which are true (i.e. non-zero) if the user is pressing them:

Code: Select all

output[0] = 0
if (left)   then output[0] = output[0] | 1
if (right)  then output[0] = output[0] | 2
if (middle) then output[0] = output[0] | 4

output[1] = velH
output[2] = velV