Added support for mouse-wheel events on Windows.

To be used in the mouse callback like this:
    if (CV_EVENT_MOUSEWHEEL == CV_GET_MOUSEWHEEL_EVENT(event))
    {
       int delta= CV_GET_WHEEL_DELTA(event);
       // use delta...
    }
This commit is contained in:
Adi Shavit
2014-01-07 21:17:57 +02:00
parent 9dc0bfc755
commit fecd5c994b
2 changed files with 46 additions and 1 deletions

View File

@@ -170,7 +170,9 @@ enum
CV_EVENT_MBUTTONUP =6,
CV_EVENT_LBUTTONDBLCLK =7,
CV_EVENT_RBUTTONDBLCLK =8,
CV_EVENT_MBUTTONDBLCLK =9
CV_EVENT_MBUTTONDBLCLK =9,
CV_EVENT_MOUSEWHEEL =10,
CV_EVENT_MOUSEHWHEEL =11
};
enum
@@ -183,6 +185,11 @@ enum
CV_EVENT_FLAG_ALTKEY =32
};
#define CV_GET_WHEEL_DELTA(event) ((short)((event >> 16) & 0xffff)) // upper 16 bits
#define CV_GET_MOUSEWHEEL_EVENT(event) (event & 0xffff) // lower 16 bits
typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
/* assign callback for mouse events */