From dcf8904037eb227485d56da446b1d5ff9dbdd15b Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sat, 23 Aug 2025 11:25:26 +0500 Subject: [PATCH] feat(input_manager): enable cursor movement in QLineEdit with left/right arrows Signed-off-by: Boris Yumankulov --- portprotonqt/input_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/portprotonqt/input_manager.py b/portprotonqt/input_manager.py index fea4305..e2c0736 100644 --- a/portprotonqt/input_manager.py +++ b/portprotonqt/input_manager.py @@ -754,6 +754,14 @@ class InputManager(QObject): # Handle key press events if event.type() == QEvent.Type.KeyPress: + # Handle QLineEdit cursor movement with Left/Right arrows + if isinstance(focused, QLineEdit) and key in (Qt.Key.Key_Left, Qt.Key.Key_Right): + if key == Qt.Key.Key_Left: + focused.cursorBackward(False, 1) # Move cursor left by one character + elif key == Qt.Key.Key_Right: + focused.cursorForward(False, 1) # Move cursor right by one character + return True # Consume the event to prevent further processing + # Open system overlay with Insert if key == Qt.Key.Key_Insert: if not popup and not isinstance(active_win, QDialog):