From 0f63d1bfa7bd45c1b733d74d869ee5a4d5776e7e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 7 Feb 2018 22:41:03 +0530 Subject: [PATCH] ... --- kittens/tui/loop.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kittens/tui/loop.py b/kittens/tui/loop.py index bde9d454d..7dd305d40 100644 --- a/kittens/tui/loop.py +++ b/kittens/tui/loop.py @@ -19,7 +19,8 @@ from functools import partial from kitty.fast_data_types import parse_input_from_terminal from kitty.icat import screen_size from kitty.key_encoding import ( - ALT, CTRL, SHIFT, C, D, backspace_key, decode_key_event, enter_key + ALT, CTRL, PRESS, RELEASE, REPEAT, SHIFT, C, D, backspace_key, + decode_key_event, enter_key ) from .handler import Handler @@ -61,7 +62,7 @@ def sanitize_term(output_fd): LEFT, MIDDLE, RIGHT, FOURTH, FIFTH = 1, 2, 4, 8, 16 -PRESS, RELEASE, DRAG = 0, 1, 2 +DRAG = REPEAT MouseEvent = namedtuple('MouseEvent', 'x y type buttons mods') bmap = {0: LEFT, 1: MIDDLE, 2: RIGHT} MOTION_INDICATOR = 1 << 5 @@ -208,7 +209,7 @@ class Loop: except Exception: pass else: - if k.mods is CTRL: + if k.mods is CTRL and k.type is not RELEASE: if k.key is C: self.handler.on_interrupt() return