Skip to content

Commit bb9ccd3

Browse files
authored
Ctrl C to copy selected text. #1557
1 parent 8f053b0 commit bb9ccd3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/qualcoder/code_pdf.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4076,7 +4076,7 @@ def handle_key(self, event):
40764076
mods = event.modifiers()
40774077

40784078
# code in vivo, etc. Plain keys only: before, Ctrl+Q marked, Ctrl+A annotated,
4079-
# Ctrl+V created an in vivo code, etc.
4079+
# Ctrl+V created an in vivo code, Ctrl C copy text, etc.
40804080
if key == Qt.Key.Key_Q and mods == Qt.KeyboardModifier.NoModifier:
40814081
self.mark()
40824082
return True
@@ -4103,6 +4103,11 @@ def handle_key(self, event):
41034103
# "(N)" without a handler.
41044104
self.mark_with_new_code()
41054105
return True
4106+
if key == Qt.Key.Key_C and mods == Qt.KeyboardModifier.ControlModifier and self.selection is not None:
4107+
pos0, pos1 = self.selection
4108+
clipboard = QtWidgets.QApplication.clipboard()
4109+
clipboard.setText(self.text[pos0:pos1])
4110+
return
41064111
# Switch coding mode: T = text, E = area/image (like the mode buttons).
41074112
if key == Qt.Key.Key_T and mods == Qt.KeyboardModifier.NoModifier:
41084113
self.set_mode("text")
@@ -4277,7 +4282,7 @@ def view_menu(self, viewport_pos, global_pos):
42774282
action_copy = None
42784283
if self.selection is not None:
42794284
menu.addSeparator()
4280-
action_copy = menu.addAction(_("Copy selected text"))
4285+
action_copy = menu.addAction(_("Copy selected text (Ctrl C)"))
42814286

42824287
# Text Analysis with AI Submenu
42834288
if self.extracted_ok:

0 commit comments

Comments
 (0)