This commit is contained in:
Kovid Goyal 2018-01-04 12:38:35 +05:30
parent 847ce37160
commit cc145ec3dd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -191,10 +191,10 @@ void
fake_scroll(int amount, bool upwards) { fake_scroll(int amount, bool upwards) {
Window *w = active_window(); Window *w = active_window();
if (!w) return; if (!w) return;
Screen *screen = w->render_data.screen; int key = upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN;
while (amount-- > 0) { while (amount-- > 0) {
send_key_to_child(w, upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN, 0, GLFW_PRESS); send_key_to_child(w, key, 0, GLFW_PRESS);
if (screen->modes.mEXTENDED_KEYBOARD) send_key_to_child(w, upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN, 0, GLFW_RELEASE); send_key_to_child(w, key, 0, GLFW_RELEASE);
} }
} }