diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-09-26 17:59:52 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <fltk@aljus.de> | 2024-10-06 18:53:03 +0200 |
| commit | 4f4a9be15b0c52837dd4d4a04ff021cc3e5d691e (patch) | |
| tree | a7238b08a93b2af73c4df86a66b7abfa47689e76 /FL/Enumerations.H | |
| parent | 3fbd4f944f0a6e16630974e56e1e896eb7bbf6f7 (diff) | |
Support mouse buttons 4 + 5 (aka "side buttons") (#1076, #1068)
This work is based on PR 1068 (patch by @CendioHalim) and
extended to store button status (4,5) in Fl::event_state() like
it's done for other mouse buttons (1-3).
Changes:
- new symbol: FL_BUTTON4 = side button 1 = "back"
- new symbol: FL_BUTTON5 = side button 2 = "forward"
- modified : FL_BUTTONS now includes bits for two side buttons
Note: the status of these new buttons is not maintained by X11,
therefore we need to maintain them in internal variables for
this platform.
Diffstat (limited to 'FL/Enumerations.H')
| -rw-r--r-- | FL/Enumerations.H | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 1beb450e5..97b4c7029 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -548,9 +548,11 @@ enum Fl_Callback_Reason { /**@{*/ -#define FL_LEFT_MOUSE 1 ///< The left mouse button -#define FL_MIDDLE_MOUSE 2 ///< The middle mouse button -#define FL_RIGHT_MOUSE 3 ///< The right mouse button +#define FL_LEFT_MOUSE 1 ///< The left mouse button +#define FL_MIDDLE_MOUSE 2 ///< The middle mouse button +#define FL_RIGHT_MOUSE 3 ///< The right mouse button +#define FL_BACK_MOUSE 4 ///< The back mouse button (side button 1) +#define FL_FORWARD_MOUSE 5 ///< The forward mouse button (side button 2) /**@}*/ // group: Mouse Buttons @@ -575,11 +577,17 @@ enum Fl_Callback_Reason { // correct for XFree86 #define FL_SCROLL_LOCK 0x00800000 ///< The scroll lock is on // correct for XFree86 -#define FL_BUTTON1 0x01000000 ///< Mouse button 1 is pushed (L) -#define FL_BUTTON2 0x02000000 ///< Mouse button 2 is pushed (M) -#define FL_BUTTON3 0x04000000 ///< Mouse button 3 is pushed (R) -#define FL_BUTTONS 0x07000000 ///< Any mouse button (1-3) is pushed -#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed +// Mouse buttons + +#define FL_BUTTON1 0x01000000 ///< Mouse button 1 is pushed (L) +#define FL_BUTTON2 0x02000000 ///< Mouse button 2 is pushed (M) +#define FL_BUTTON3 0x04000000 ///< Mouse button 3 is pushed (R) +#define FL_BUTTON4 0x08000000 ///< Mouse button 4 is pushed (BACK) +#define FL_BUTTON5 0x10000000 ///< Mouse button 5 is pushed (FORWARD) +#define FL_BUTTONS 0x1f000000 ///< Bitmask: any mouse button (1-5) is pushed + +#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n = 1..5) is pushed, + ///< *undefined* if n outside 1..5 #define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now // FIXME: Unicode needs 21 bits! |
