Show HN: Compose Key on macOS
github.com
github.com
macOS however already has built in Option + key chords for most accented characters, so I rarely need to use a Compose key there.
That said, I imagine having a Compose key on macOS would be useful for typing custom characters, emojis and Unicode.
Compose Key
Every OS and DE I've used has the option to configure a US keymap with "dead keys", which works similarly to a typewriter - you type, for instance the acute accent (') and the cursor doesn't move until you type the next key, so if you do 'a it gives you á, 'c gives you ç, ~o gives you õ etc.
On macOS, I personally use the Brazilian - Pro mapping but there might be others. There's nothing particularly "Brazilian" about that mapping either so it might just work for you regardless.
I recall using one called "US International" or something similar on Windows and Linux.
Many (most?) Windows layouts that are not US, like English-UK, will likely have combos with AltGr that are more useful than US International.
I use Colemak, which has a compose triggered with AltGr+` and a bunch of others. I couple that with AutoHotkey to trigger it via CapsLock, as documented here: http://blog.pythonaro.com/2020/06/better-access-to-special-c...
MacOS is a different beast, I currently do stuff with a programmable keyboard but Alt+` is a pretty good compose combo.
macOS's Option + key chords are highly productive but aren't supported on all platforms, so I settled on the Compose key as a compromise. (my Compose key is mapped to the Menu key on Windows keyboards which almost nobody ever uses -- in contrast the Windows key is used a lot)
Compose keystrokes are slower because they are sequences and not chords, but they're intuitive enough and work well for me.
On MacOS to get accents you just "hold <vowel>, and press <number in pop up for the accent you want>".
For ü, "hold u, press 2".
You don't need to use "Option" for anything.
I've been "holding the letter" for 5 years at least.
I’ve also used System 6, 7 and Mac OS 9 so I have habits from that time too.
On MacOSX, I just hold u, and a menu appears, that allows me to select ü by just pressing 2. So I end up just doing u+2. With the huge advantage that I don't have to remember the combinations.
Similar for emojis and pretty much anything else you'd like to type as others have mentioned.
So the only question i have is: why? Really. Why would anyone go through the trouble of porting compose keys to macosx, when macosx native solution is so much better?
Time would be better spent on porting MacosX solution to Linux, Windows, et. al.
Why is macosx system is better? Compose keys are mnemonic: e + . = ė ‒ you don't need to remember any abitrary codes and there are no popups or any implicit accidents.
I've tried many different schemes etc and compose key is still my favorite system and having unified system for linux and macos is big bonus for cross platform users. At the end of the day it's just another option! :)
No, it does not. Holding u briefly overlays a keyboard of "compositions" for u, and you can just press whatever key you want afterwards to pick one, see: https://osxdaily.com/2017/03/22/type-accents-mac-easy/
> Why is macosx system is better? Compose keys are mnemonic
Because macosx system is not mnemonic. If I need to type a particular accent, which I do very often, and there are O(50) variations of them, I don't have to remember anything. Instead, the computer shows me all the options as a type, and I just pick the one I want.
---
If I need to type "u" 42 times for whatever reason, holding u and waiting sucks anyways. Every editor I use has a better more precise way of doing this (on my emacs its just meta+42+u), and worst case I can always just do cmd+space and execute "repeat 42 u" or similar.
The only reason I can think of is that some people like to have the hold key action repeatedly type the specified character and the compose menu gets in the way of that. This is a relatively clever way of keeping both features active without having to repeatedly resort to terminal commands.
Also as others have noted, cmd-ctrl-space opens the Character Viewer, which lets you search the entire unicode space, including emoji, for characters. Hit the gear at the upper left and do 'customize list' to pick just which sets you like, I have never actually had a need to type 𓂀 but who knows what the future will bring?
1. It enters the text and _then_ replaces it which for me is really distracting.
2. It has this little pop up even for a single option which is also very distracting.
Maybe it's my niche use case but I type and read a lot and I prefer the input to stay visually minimalistic to not tire myself out.
I will note two alternatives, depending on what you're trying to do:
* System Preferences > Keyboard > Text lets you specify replacements. For example, if I type ! ? (without the space) I get ‽, because who doesn't want an interrobang?
* https://matthewpalmer.net/rocket/ Rocket lets you add emoji anywhere using a syntax like Slack's
I also spend time on Windows and nothing seems to come close to this convenient (win-. has a few useful things like the character picker panel in macOS but to get more, tools like autohotkey feel really cumbersome).
1. Text Replacement enters the text and _then_ replaces it which for me is really distracting.
2. It has this little pop up even for a single option which is also very distracting.
The benefit of it however is that it's more stable (as mentioned in README so apps ignore user keybinds for some reason)
This is very good! Congrats!
[1] https://www.trankynam.com/atext/ [2] https://textexpander.com/
Actually it does. The entire Japanese & Chinese input systems are built exactly on that system.
[1]https://medium.com/@nikitavoloboev/karabiner-god-mode-7407a5...
In Linux I've put compose and dead greek (with shift) on the right alt, caps on the right ctrl.
I still wish keyboards were different, some keys to the left of the keyboard would be nice.