diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-06-26 14:43:51 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-07-04 17:23:21 +0200 |
commit | b064110f9640e19e7c582ad7aa227ea03ac07fe7 (patch) | |
tree | 391d9ae92a2d1bb225f29807eada7f6565fc41c1 | |
parent | 47f4a39fa39e5f4c8b7ef8fc91d90728c9880220 (diff) | |
download | mupdf-b064110f9640e19e7c582ad7aa227ea03ac07fe7.tar.xz |
gl: Track modifier keys during mouse events too.
-rw-r--r-- | platform/gl/gl-ui.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/gl/gl-ui.c b/platform/gl/gl-ui.c index 5fcede1b..2d8fd5be 100644 --- a/platform/gl/gl-ui.c +++ b/platform/gl/gl-ui.c @@ -223,8 +223,8 @@ static void on_keyboard(unsigned char key, int x, int y) ui.mod = glutGetModifiers(); ui.plain = !(ui.mod & ~GLUT_ACTIVE_SHIFT); run_main_loop(); + ui.key = ui.plain = 0; ui_invalidate(); // TODO: leave this to caller - ui.key = ui.mod = ui.plain = 0; } static void on_special(int key, int x, int y) @@ -266,8 +266,8 @@ static void on_special(int key, int x, int y) ui.mod = glutGetModifiers(); ui.plain = !(ui.mod & ~GLUT_ACTIVE_SHIFT); run_main_loop(); + ui.key = ui.plain = 0; ui_invalidate(); // TODO: leave this to caller - ui.key = ui.mod = ui.plain = 0; } } @@ -275,6 +275,7 @@ static void on_wheel(int wheel, int direction, int x, int y) { ui.scroll_x = wheel == 1 ? direction : 0; ui.scroll_y = wheel == 0 ? direction : 0; + ui.mod = glutGetModifiers(); run_main_loop(); ui_invalidate(); // TODO: leave this to caller ui.scroll_x = ui.scroll_y = 0; @@ -318,6 +319,7 @@ static void on_mouse(int button, int action, int x, int y) case GLUT_RIGHT_BUTTON: ui.right = 0; break; } } + ui.mod = glutGetModifiers(); run_main_loop(); ui_invalidate(); // TODO: leave this to caller } @@ -326,6 +328,7 @@ static void on_motion(int x, int y) { ui.x = x; ui.y = y; + ui.mod = glutGetModifiers(); ui_invalidate(); } @@ -333,6 +336,7 @@ static void on_passive_motion(int x, int y) { ui.x = x; ui.y = y; + ui.mod = glutGetModifiers(); ui_invalidate(); } |