Skip to content

Commit ad4cc53

Browse files
Deleted the code related to modifying the cursor direction.
1 parent a6b702f commit ad4cc53

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

ui/widgets/qText_edit.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,7 @@ def set_ctrl(self):
4444
self.parent.menu_bar.copy_verse_action.setEnabled(status)
4545

4646
def keyPressEvent(self, e):
47-
48-
49-
cursor = self.textCursor() # Get the current text cursor
50-
51-
if e.key() == Qt.Key.Key_Right:
52-
if e.modifiers() & Qt.KeyboardModifier.ControlModifier:
53-
cursor.movePosition(cursor.MoveOperation.NextWord) # Move to the start of the next word
54-
else:
55-
if cursor.atBlockEnd(): # If at the end of the line, move to the start of the next line
56-
cursor.movePosition(cursor.MoveOperation.NextBlock)
57-
else:
58-
cursor.movePosition(cursor.MoveOperation.Left) # Move one character to the right
59-
self.setTextCursor(cursor)
60-
61-
elif e.key() == Qt.Key.Key_Left:
62-
if e.modifiers() & Qt.KeyboardModifier.ControlModifier:
63-
cursor.movePosition(cursor.MoveOperation.PreviousWord) # Move to the start of the previous word
64-
else:
65-
if cursor.atBlockStart(): # If at the beginning of the line, move to the end of the previous line
66-
cursor.movePosition(cursor.MoveOperation.PreviousBlock)
67-
cursor.movePosition(cursor.MoveOperation.EndOfBlock)
68-
else:
69-
cursor.movePosition(cursor.MoveOperation.Right) # Move one character to the left
70-
self.setTextCursor(cursor)
71-
72-
else:
73-
super().keyPressEvent(e)
74-
75-
47+
super().keyPressEvent(e)
7648
self.set_ctrl()
7749

7850
if e.key() == Qt.Key.Key_Space:
@@ -119,4 +91,4 @@ def keyPressEvent(self, e):
11991
self.is_page_turn_alert = True
12092
Globals.effects_manager.play("alert")
12193
return
122-
self.parent.OnNext()
94+
self.parent.OnNext()

0 commit comments

Comments
 (0)