From cc145ec3dd8e24add112e0cad862cb8889bd8bc2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Jan 2018 12:38:35 +0530 Subject: [PATCH] DRYer --- kitty/keys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/keys.c b/kitty/keys.c index 00f08e059..f640f2c16 100644 --- a/kitty/keys.c +++ b/kitty/keys.c @@ -191,10 +191,10 @@ void fake_scroll(int amount, bool upwards) { Window *w = active_window(); if (!w) return; - Screen *screen = w->render_data.screen; + int key = upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN; while (amount-- > 0) { - send_key_to_child(w, upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN, 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_PRESS); + send_key_to_child(w, key, 0, GLFW_RELEASE); } }