alex-hhh/ActivityLog2

Support keyboard shortcuts on Linux for copy/paste

misev opened this issue · 5 comments

misev commented

In the text fields, e.g. when editing an activity, copy/paste/cut with Ctrl-C/Ctrl-V/Ctrl-X are not working on Linux.

I tried to figure out how to enable them, but the most I managed to do is add support for paste from Primary selection buffer with middle mouse button click (usually the wheel nowadays).

diff --git a/rkt/al-widgets.rkt b/rkt/al-widgets.rkt
index 00e8e1d..a5e53ce 100644
--- a/rkt/al-widgets.rkt
+++ b/rkt/al-widgets.rkt
@@ -31,6 +31,8 @@
          "utilities.rkt"
          "widgets/main.rkt")

+(editor-set-x-selection-mode #t)
+
 (provide sport-selector%)

Can you try if the following key board shortcuts work on Linux: Control + y for paste, Control + w for cut and Alt + w for copy?

misev commented

These work indeed, seems to be the Emacs scheme?

These are the default key bindings that the Racket GUI library uses -- on Windows it's Ctrl-{C,X ,V} and I suspect on MacoS it is Command-{C,X,V}. I will need to investigate on how to change the defaults, maybe I'll ask on the Racket lists first.

It turns out that the Emacs key bindings were the default for Linux in the Racket GUI libraries. I talked with the Racket developers and they changed them to the more common Windows bindings. This change will be available in the next Racket version (in about 3-4 months time) but it will also be available in the nightly snapshots in a day or so -- you will need to download a new Racket version and rebuild ActivityLog2 with it.

racket/gui@b15f4c5

misev commented

Thanks for the swift fix! It seems very unlikely I would've been able to fix this myself.