浏览代码

LibVT: Don't scroll to bottom for Ctrl/Alt/Shift

It's nice that we scroll the cursor into view when typing in a terminal
but it's not necessary when pressing only Ctrl, Alt of Shift.
Andreas Kling 5 年之前
父节点
当前提交
5a84944dc8
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Libraries/LibVT/TerminalWidget.cpp

+ 2 - 1
Libraries/LibVT/TerminalWidget.cpp

@@ -244,7 +244,8 @@ void TerminalWidget::keydown_event(GKeyEvent& event)
         write(m_ptm_fd, &ch, 1);
     }
 
-    m_scrollbar->set_value(m_scrollbar->max());
+    if (event.key() != Key_Control && event.key() != Key_Alt && event.key() != Key_Shift)
+        m_scrollbar->set_value(m_scrollbar->max());
 }
 
 void TerminalWidget::paint_event(GPaintEvent& event)