(In fairness, I have found one weak spot, namely font support… I’ve used ‘unicode-fonts’ [1] with some success, but reportedly it doesn’t work with the latest Emacs. Ah well, it’s at least fairly rare that this becomes a problem in practice.)
So many people have their own preferences for how to type these characters, write an input method for Emacs, and get it included.
Is it really convenient? I don't like to wait and would rather prefer to press a sequence of "Compose", "a", "1", (or, which is faster, "a" and "1" simultaneously). And make a popup appear when "Compose" + "a" is pressed.
Linux has Compose key, but it is implemented poorly, it doesn't provide an UI for selecting character and discovery of combinations, and in Gnome it has very small choice of characters.
Another alternative would be to insert accented characters automatically.
(I admit I am engaging in the rhetorical tactic of confidently asserting that something is impossible in the hopes that someone will be lured to come along and correct me, so that I can be happily wrong.)
This way you can have Emacs style meta key cursor movement bindings in macOS text widgets. For me M-f and M-b are indispensable.
/* -*- coding: utf-8 -*- */
{
"~/" = ("insertText:", "λ");
"~a" = ("insertText:", "∀ ");
}
It looks like you can actually send arbitrary objectiveC messages to the first responder with this, but I haven't played with it much.(I'm also now using the `fn` key to toggle between greek and US.)
For the languages I use is it is mostly a matter of AltGr + key, which is quite ergonomic. It would suffer greatly if I had to make long presses as that would kill my typing speed.
Not to distract from how awesome Emacs is though. Just wanted to add a solution for those who regularly type text in different languages.
MacOS menu for accented characters is must have for me and I cannot understand why other OS are not adopting it.
Thanks for the article, it's a nice trick
And on iPhones, I never actually hold « e » to show the accents, their system figures out the accents. Although it missed sometimes, it’s pretty good. I can just type « je suis arrivee a la maison » and it accentuâtes my letters properly. Actually, I had to manually remove the accents for this exemple ^^
Édit: ok, that’s kinda funny, it must be because I typed French in English and it messed it up, but « accentuâtes » doesn’t make any sense, same with « édit » it just inferred for my. Leaving the message as is for the lols
AltGr+e for grave accent and AltGr+' for acute accent.
Much better than auto completion boxes
My language, as yours, contains a lot of accented letters and it would be absolutely impractical to chose them from a dropdown.
p.s. I type on an Italian keyboard with UK layout because it's more comfortable for typing code
Constantly switching keyboard layout can be almost as disruptive as waiting for a dropdown to appear.
The most common scenario is that I'm writing a mixture of English and Japanese, and I can't do that without switching layouts.
what's disruptive is that keys are in different places
; on IT keyboards needs SHIFT
~ is not present
| is on the other side of the keyboard
etc etc
If I'm switching keyboard layouts, I'm not programming in both layouts. I'm programming in a variation of the US layout, and writing natural language text in a different layout. I'm sure it is disruptive at first, but I got used to it such a long time ago at this point.
There are also a lot of games that don't work except in the QWERTY layout, so I am always switching if I play a game. I have gotten used to it.
I've only ever figured out how to type accents for foreign languages on Macs. Windows has the ALT+1234 gibberish that you have to memorize. I've been fighting against layouts and IMEs on Linux for at least two decades at this point and there are at least three different ways to set the keyboard layout, each of which affect different applications, and some applications seem to ignore the keyboard layout I set. As a result, I often just kind of give up on typing accented characters except on a Mac.
I could see that sending the wrong character initially to an online program is suboptimal, but we often do that anyway and have to hit delete.
Another thought, why is there no clever autocorrect to try to add the ¿ in the right spot? Again, not the desired behavior always, but in many cases. It could be a suggestion that you must approve. Thankfully, texting has shown that Spanish users are not that keen on correct punctuation.
As with many of these things, it’s a holdover from typewriters. ‘Dead keys’ in typewriters were literally keys which did not move the carriage to the next position: thus to get accented characters you would type the dead key, then the letter, so that both would end up in the same position on the page. (Incidentally, this also explains why we so often use SPC after a dead key to get the base character.)
It's still the mac way. The long press thing is only usable if you just need accents once in a while, and can be disabled.
I can type couple words during the time it would take to input one character...
Also, while typing 10 characters per second visual elements stop working. When I make a mistake and visual signal has to reach my brain and be recognised I have typically already typed half a dozen characters.
I switch between a keymap with and one without dead keys with a single shortcut depending on whether I'm typing English/programming, or Portuguese/other accented languages.
Isn't the entire point of this popup to give you a visual fallback option if you e.g. aren't a native speaker and don't know how to type it otherwise? For instance, assuming an english keyboard layout, typing á is a matter of "Alt-e a".
I don't think it's meant to be the primary input method for native speakers?
I'm assuming you meant that as an affirmation despite the use of the question mark.
If that's the case, then I agree it makes sense! I find macOS's default to have this enabled pretty bad though. I understand it on iDevices where dead keys would be awkward but not on a computer with a full, physical keyboard.
You can select the accented character with number keys (e.g. 1 for the first option), and you can reduce the delay in the panel appearing by reducing the key delay:
defaults write NSGlobalDomain InitialKeyRepeat -int 12
Together, you can select accented letters in a few milliseconds. You can reset the delay to default with: defaults write NSGlobalDomain InitialKeyRepeat -int 25If I have to long-press (however short "long" might be), plus remember which number corresponds to which accent on each letter, that's a lot more than what I have now - accents make sense as you type the actual accent plus the letter. The only "exceptions" to this intuitiveness are 'c for ç (not an issue on PT or BR keyboards which have a dedicated key for that) and arguably " for umlauts like ü (I think only in pt_BR and even then it's not in use since the unification of the orthographies in the 90s).
(With good support for all(?) the Latin-based languages, and also Greek... I kind of wish they had managed to fit Cyrillic on another mode too !)
P.S.: better than the old AZERTY for math & code too !
> macOS has a wonderful input mechanism where you press and hold a key on your keyboard to display the accent menu.
The depth of my ignorance may be unbounded....
Anyhow, thanks! I'll use it!