简体   繁体   中英

how to have mouse hold down right click in C#

I figured out how to have mouse right click when certain events occur(in my case Kinect skeleton data)

mouse_event((uint)(MouseEventFlags.RIGHTDOWN | MouseEventFlags.RIGHTUP),(uint)mousepos.X, (uint)mousepos.Y, 0, 0);

This code performs mouse right click only once. How can I make it so it happens longer similar to holding down my mouse right click as long as I am doing certain gesture in Kinect?

You need to use mentioned events with some timer between them.

Example:

MouseDown
    Start Timer
MouseUp
    Disable Timer

Then you can do whatever you want between timers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM