mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Prevent scrollback buffer reset when using copy shortcut
Prevents scrollback buffer reset (i.e. scrolling to the bottom of terminal output) when pressing modifier keys in isolation or when copying text using the shortcut Ctrl+Shift+C.
This commit is contained in:
parent
cf613708c4
commit
b76f8d0939
2 changed files with 10 additions and 2 deletions
|
@ -175,8 +175,14 @@ func _refresh():
|
|||
func _gui_input(event):
|
||||
_native_terminal._gui_input(event)
|
||||
|
||||
if event is InputEventKey:
|
||||
_native_terminal.sb_reset() # Return to bottom of scrollback buffer if we scrolled up.
|
||||
if event is InputEventKey and event.pressed:
|
||||
# Return to bottom of scrollback buffer if we scrolled up. Ignore modifier
|
||||
# keys pressed in isolation or if Ctrl+Shift modifier keys are pressed.
|
||||
if (
|
||||
not event.scancode in [KEY_ALT, KEY_SHIFT, KEY_CONTROL, KEY_META, KEY_MASK_CMD]
|
||||
and not (event.control and event.shift)
|
||||
):
|
||||
_native_terminal.sb_reset()
|
||||
|
||||
_handle_mouse_wheel(event)
|
||||
_handle_selection(event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue