summaryrefslogtreecommitdiff
path: root/platform/gl
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-26 14:43:51 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-04 17:23:21 +0200
commitb064110f9640e19e7c582ad7aa227ea03ac07fe7 (patch)
tree391d9ae92a2d1bb225f29807eada7f6565fc41c1 /platform/gl
parent47f4a39fa39e5f4c8b7ef8fc91d90728c9880220 (diff)
downloadmupdf-b064110f9640e19e7c582ad7aa227ea03ac07fe7.tar.xz
gl: Track modifier keys during mouse events too.
Diffstat (limited to 'platform/gl')
-rw-r--r--platform/gl/gl-ui.c8
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();
}