diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-07-07 20:25:12 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-07-07 20:25:12 +0200 |
| commit | 317e06e5a3f3cc810466dc13bdc825789a182e00 (patch) | |
| tree | 12aa3e95ecf661dff87a75c4daf137e479b890d1 /FL/Fl.H | |
| parent | 2252ba98390505f353ea35e8ade3e3914b46c977 (diff) | |
X11: fix extraneous (undefined) event state bits
- Restrict FL_BUTTONS mask to only three valic mouse buttons.
Pseudo mouse buttons 4-7 are used for FL_MOUSEWHEEL events and
are no longer reflected in Fl::event_buttons().
- Return only state of mouse buttons 1-3 in Fl::event_buttons().
Buttons 4-7 are not "sticky" (used for FL_MOUSEWHEEL).
- Keep undefined keyboard related bits in Fl::event_state() for
backwards compatibility and transparency. These bits may be masked
out in a later release.
- Document Fl::event_state() bits for X11 in src/Fl_x.cxx.
Note: this is a bug fix for X11 only, Wayland and other platforms are
not affected.
Diffstat (limited to 'FL/Fl.H')
| -rw-r--r-- | FL/Fl.H | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1263,22 +1263,22 @@ public: caused an FL_RELEASE event, you can use Fl::event_button() instead. \return a bit mask value like { [FL_BUTTON1] | [FL_BUTTON2] | [FL_BUTTON3] } */ - static int event_buttons() {return e_state&0x7f000000;} + static int event_buttons() {return e_state & FL_BUTTONS;} /** Returns non-zero if mouse button 1 is currently held down. For more details, see Fl::event_buttons(). */ - static int event_button1() {return e_state&FL_BUTTON1;} + static int event_button1() {return e_state & FL_BUTTON1;} /** Returns non-zero if button 2 is currently held down. For more details, see Fl::event_buttons(). */ - static int event_button2() {return e_state&FL_BUTTON2;} + static int event_button2() {return e_state & FL_BUTTON2;} /** Returns non-zero if button 3 is currently held down. For more details, see Fl::event_buttons(). */ - static int event_button3() {return e_state&FL_BUTTON3;} + static int event_button3() {return e_state & FL_BUTTON3;} /** @} */ /** |
