Skip to content

Commit

Permalink
Fix #8099
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 4, 2024
1 parent 463f17f commit e08806a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kitty/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
get_mouse_data_for_window,
get_options,
is_css_pointer_name_valid,
is_modifier_key,
last_focused_os_window_id,
mark_os_window_dirty,
monotonic,
Expand Down Expand Up @@ -987,11 +988,16 @@ def send_key(self, *args: str) -> bool:
sk = sk.resolve_kitty_mod(km)
events.append(KeyEvent(key=sk.key, mods=sk.mods, action=GLFW_REPEAT if human_key == prev else GLFW_PRESS))
prev = human_key
scroll_needed = False
for ev in events + [KeyEvent(key=x.key, mods=x.mods, action=GLFW_RELEASE) for x in reversed(events)]:
enc = self.encoded_key(ev)
if enc:
self.write_to_child(enc)
if ev.action != GLFW_RELEASE and not is_modifier_key(ev.key):
scroll_needed = True
passthrough = False
if scroll_needed:
self.scroll_end()
return passthrough

def send_key_sequence(self, *keys: KeyEvent, synthesize_release_events: bool = True) -> None:
Expand Down

0 comments on commit e08806a

Please sign in to comment.