Python Forum

Full Version: Asking users to create keyboard shortcuts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.