diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-08-05 16:37:38 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-08-05 16:37:38 +0200 |
| commit | 5bcd6ca8f2578b959f64d12334cb5454d840ae7d (patch) | |
| tree | b5b2d5a1b010df6c4a0291d2c9088bf2bff6effb /test/keyboard.cxx | |
| parent | 3049e6394a3376f7fff1c8cde19fd7bb1a9252ec (diff) | |
Revert "#733 partial: Adds rotation gesture event on MacOS"
This reverts commit 3049e6394a3376f7fff1c8cde19fd7bb1a9252ec
as agreed upon in GitHub Issue #733.
Diffstat (limited to 'test/keyboard.cxx')
| -rw-r--r-- | test/keyboard.cxx | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/test/keyboard.cxx b/test/keyboard.cxx index dd6feeb0f..46ba6142f 100644 --- a/test/keyboard.cxx +++ b/test/keyboard.cxx @@ -43,22 +43,11 @@ int handle(int e) { return (e == FL_SHORTCUT); // eat all keystrokes } -int MyWindow::handle(int event) { - static int r = 0; - switch (event) { - case FL_MOUSEWHEEL: { - int x = (int)(w_scroll->xvalue() - Fl::event_dx()); - int y = (int)(w_scroll->yvalue() - Fl::event_dy()); - w_scroll->value( (double)(x&31), (double)(y&31) ); - return 1; } - case FL_ZOOM_GESTURE: { - int z = (int)(w_zoom->yvalue() + Fl::event_dy()); - w_zoom->value( (double)(z&255), (double)(z&255) ); - return 1; } - case FL_ROTATE_GESTURE: { - r = r - (Fl::event_dy()/100.0); - w_rotate->value( (double)(r&1023) ); - return 1; } +int MyWindow::handle(int msg) { + if (msg==FL_MOUSEWHEEL) { + roller_x->value( roller_x->value() + Fl::e_dx * roller_x->step() ); + roller_y->value( roller_y->value() + Fl::e_dy * roller_y->step() ); + return 1; } return 0; } |
