Python Forum
Asking users to create keyboard shortcuts - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Asking users to create keyboard shortcuts (/thread-39532.html)



Asking users to create keyboard shortcuts - Gribouillis - Mar-03-2023

I'm writing the best Latex generating Python program ever, but I'm using special characters that you plobably don't have natively on your keyboard layout, namely
>>> "\u00AB\u00BB\u00A6\u2026"
'«»¦…'
I use a Bépo layout, so these characters are immediately available to me.

I intend not to be the sole user of this program, so if I distribute it one day or the other, I will probably require that users be able to enter these characters in their documents. My question is Suppose a program requires you to enter the characters « ¦ » or …, would that be a serious problem to you, considering your OS or your favorite editor ?

For example, let's take users with a Linux/KDE setup without « on their keyboard. They could define a global shortcut that would run the command
Output:
python3 -c 'from pynput.keyboard import Controller; Controller().type("\u00ab")'
I tested this and it works well, furthermore, it looks multiplatform, so if you are able to define global shortcuts, it may work for you too.