Jump to content
Sign in to follow this  
Guest JeanLuc_

Left and Right mouse button...

Recommended Posts

Hello,In one of my gauges (coded in C), I'd like to simulate a button that can be pushed or pulled. To do this, I wanted to use left mouse button to push, and right button to pull.I wrote the following C code:MOUSE_BEGIN( autopilot_mouse_rect, HELP_NONE, 0, 0 ) MOUSE_CHILD_FUNCT( 2,38,13,13, CURSOR_HAND, MOUSE_LEFTSINGLE, speed_push_cb ) MOUSE_CHILD_FUNCT( 2,38,13,13, CURSOR_HAND, MOUSE_RIGHTSINGLE, speed_pull_cb )MOUSE_ENDAnd it doesn't work. Only the second line is taken into account, the first action (left button) is ignored.How can I define 2 actions (with 2 mouse buttons) on the same button?Thanks for any help.

Share this post


Link to post
Share on other sites
Guest bartels

It is impossible. You can't use any other button then the left one (maybe the scrollwheel, but never the right one). You can however use one mouse area and check the previous state, so first action pull, second action push or something like that.Arne Bartels

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Hum.... Another limitation? well, Dreamfleet provides left/ right / wheel support on a single hotspot, the latest Reality XP ATD also does (left / right / wheel on a single hotspot). It is possible and works pretty well. Here is a hint:MOUSE_CHILD_FUNCT(0,0,47,47,CURSOR_HAND, MOUSE_LEFTSINGLE | MOUSE_RIGHTSINGLE | MOUSE_DOWN_REPEAT, PFD_M_cb)You should figure out now how to work on the PFD_M_cb function to differentiate the left from the right clicks (any experience with binary operators??? it's all in the SDK, look at the mouse flags!!)As for the wheel? well, the left/right code is a good start...Hope this helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...