mouse button information

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

mouse button information

Post 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
Attachments
USB_Sketch.fcf
(11.5 KiB) Downloaded 266 times

User avatar
Steve
Matrix Staff
Posts: 3421
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: mouse button information

Post 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.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: mouse button information

Post 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

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: mouse button information

Post 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

User avatar
Steve
Matrix Staff
Posts: 3421
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: mouse button information

Post 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

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: mouse button information

Post 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
Attachments
USB_Sketch_mod.fcf
(13.5 KiB) Downloaded 275 times

User avatar
Steve
Matrix Staff
Posts: 3421
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: mouse button information

Post 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

Post Reply