Most Useful Discovery for Online Woodworkers EVER EVER EVER

UKworkshop.co.uk

Help Support UKworkshop.co.uk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
In my job, I use a lot of symbols when typing and I got fed up with the alt codes as they seem such a backwards way of doing it. To make my life easier I wrote a little application (written in python, but can be compiled to a windows executable so it doesn't require python) that makes symbol entry much easier (in my opinion). With it, you hit Win+K (or whatever key combination you've configured) and a very simple window pops up:

View attachment 141847

In that window, you type two characters. When you type the second character, the window disappears and a symbol gets pasted into whichever application you were using before pressing the shortcut. So, for example, I hit Win+K then Co and the result is ©.

The symbol obviously depends on which two characters you type, but I think they're a lot more intuitive than the alt codes (I didn't invent them: they came from a text editor called Vim that has native support for these codes) ...
The Alt+<numeric code> thing (being a Microsoft convention I think?) doesn't work at all on Linux. The Linux (or at least Gnome) way of doing it is is pretty much the same as you've described, except that there is no need for a window to pop up. As I'm typing if I do <Scroll Lock> Co I get © . <Scroll Lock> is the default Compose key, but it can be configured to whatever you want. I agree that this is a much easier way of doing it. The two letter codes in Linux/Gnome are often (but not always) as in your table - unsurprising perhaps as vim is derived from vi which was written for Unix, so branches of the same tree. Linux also allows Unicode characters, for example 𝜒 hasn't got a two-letter code but can be had with <Ctrl>+<Shift>+<u> 1D712 <Enter>. Ugly, but sometimes necessary! No idea how to do Unicode in Windows or MacOS, but presumably possible?

Bob.
 
In my job, I use a lot of symbols when typing and I got fed up with the alt codes as they seem such a backwards way of doing it. To make my life easier I wrote a little application (written in python, but can be compiled to a windows executable so it doesn't require python) that makes symbol entry much easier (in my opinion). With it, you hit Win+K (or whatever key combination you've configured) and a very simple window pops up:View attachment 141847

In that window, you type two characters. When you type the second character, the window disappears and a symbol gets pasted into whichever application you were using before pressing the shortcut. So, for example, I hit Win+K then Co and the result is ©.

The symbol obviously depends on which two characters you type, but I think they're a lot more intuitive than the alt codes (I didn't invent them: they came from a text editor called Vim that has native support for these codes). Examples:

DG makes °
2S makes ²
2s makes ₂
12 makes ½
-: makes ÷
+- makes ±
OK makes ✓
>= makes ≥
=> makes ⇒
TM makes ™
/- makes †
m* makes μ
l* makes λ
p* makes π
W* makes Ω (the letter, * pattern works for all the Greek alphabet letters)
c, makes ç
e' makes é
e> makes ê
e: makes ë
O/ makes Ø
?= makes ≅
!= makes ≠
-N makes – (en-dash)
... and the list goes on

The application used to be published on bitbucket before they removed support for the version control system it was written in. I keep meaning to release it somewhere else (on my website if nothing else), but have never got round to it. I use it many, many times a day and would hate to have to go back to using ALT codes (especially since I sometimes use a laptop without a numeric keyboard and the ALT codes don't work on the top row number keys). However, I guess I'm probably relatively unusual in the number of times a day I type μ, ° and ±, so I'm not sure how widely appealing my little application would actually be!

The lookup table I have printed by my desk (not that I have to refer to it very often as I find most of the codes easy to remember):

View attachment 141849

I finally pulled my finger out and ported my "digraph" tool to C++ so it's easy to publish as a Windows executable. If anyone's interested in downloading it and being able to type symbols intuitively rather than using obscure Alt-codes, these are the links:

Source code (and detailed README with instructions on how to install & use): GitHub - abudden/digraph: Digraph is a tool to simplify typing of symbols
Releases (executable binary): Releases · abudden/digraph
 
Do you have the Python version still? I'd be interested,
or is the C version viable in Linux please?
Any X server you are likely to encounter will natively support a compose key, allowing similar digraph-based entry. Not too sure about Wayland so it may depend on the distribution.
 
Do you have the Python version still? I'd be interested,
or is the C version viable in Linux please?

I have the python version, but the C version is viable in Linux with a similar amount of effort to be honest. Neither will work directly out of the box on Linux, but I don't think it'd be hard to get it at least mostly working on Linux.

The incompatibility (in both python and C versions) is down to the way it sends the character to the application you're typing into. The digraph app puts the required character onto the clipboard (in a cross-platform manner) and then sends a keyboard shortcut (Shift-Insert by default) to the last active window. That process of sending a keyboard shortcut to another application is platform specific.

The critical platform specific code is in the three functions that start here: digraph/windows_specific.cpp at master · abudden/digraph

I'm afraid I don't know enough about Linux GUI programming to know how to make that bit work on Linux. I guess a simple option would be to just do nothing and let the user manually paste after entering the digraph.

Anyway, if you want to chat it through and I'll see what I can do to help, it's probably best that we chat over email rather than on this forum. The first part of my email address is "al". The second part is my website address without the www. (see signature) - sorry, I don't want to write it out in plain text and make it easy for the spambots!

Edit: as @ajs has said, there should be more direct methods built into Linux anyway (I think that's where the digraphs that my program uses originally came from, although I extracted them from the Vim text editor). I guess the advantage of my tool on Linux would be the optional larger GUI to help you choose which characters to type.
 
Any X server you are likely to encounter will natively support a compose key, allowing similar digraph-based entry. Not too sure about Wayland so it may depend on the distribution.
According to Wikipedia the default for X.org maps the Compose key to Shift-AltGr so I'd try that in the first instance, so e.g Shift-AltGr , c (That's Shift and AltGr together, followed by comma, followed by "c") would give you a c-cedilla. Not in front of a Unix system right now and even when I get home it'll be a NetBSD system with a physical compose key, so I'd tend to take that on trust for the minute.
 
So how can I get a tick mark please?
Took me ages to find these ✓ ✔
✓ = Alt 10003
✔ = Alt 10004
I keep a text file of the different characters & their codes on the PC as it's often easier to copy & paste.
 
Back
Top