Diacritic Key
-
- Location: Sioux Falls, SD, US
- Main keyboard: Clueboard 66/Zilents/Originative
- Main mouse: Razer Naga 2014
- Favorite switch: Zealencioed Zilents, 45g
- DT Pro Member: -
Hello!
I was wondering if anyone out there had ever programmed a key for generating diacritics.
I was thinking that the key would work like a sort of toggle. Press the diacritic key, then press the letter you want the diacritic over. Then, type the character you want the diacritic to be. For instance:
Diacritic, then U, then : would result in a Ü.
Thank you!
I was wondering if anyone out there had ever programmed a key for generating diacritics.
I was thinking that the key would work like a sort of toggle. Press the diacritic key, then press the letter you want the diacritic over. Then, type the character you want the diacritic to be. For instance:
Diacritic, then U, then : would result in a Ü.
Thank you!
- pr0ximity
- Location: Maine, USA
- Main keyboard: Anything linear with Cherry caps
- Main mouse: Microsoft WMO 1.1A
- Favorite switch: IBM Beamspring (metal chassis)
- DT Pro Member: 0173
I've done a fair amount of "press for Esc, hold and press something else for Ctrl+something" bindings in Karabiner, so it might be possible to make every character a Fn key when held that exposes a layer of all of the decorated single characters. In Karabiner however this results in a noticeable delay when typing so you can't really type that fast. But the idea may be applicable to other software that isn't as limited.
I assume you don't want a simple layer of combining marks, like typing U then Fn+: for the umlaut combining character?
I assume you don't want a simple layer of combining marks, like typing U then Fn+: for the umlaut combining character?
- zslane
- Location: Los Angeles, California, USA
- Main keyboard: RealForce RGB
- Main mouse: Basic Microsoft USB mouse
- Favorite switch: Topre
- DT Pro Member: -
Yes, that is generally what R-Alt is used for these days if you have an international keyboard layout running. If your default keyboard layout under Window, for instance, is English US, then just add the US International layout, and when that is active, the R-Alt key becomes an Alt Graph key and functions pretty much exactly as you are describing.
- Ratfink
- Location: North Carolina, USA
- Main keyboard: IBM Displaywriter
- Main mouse: CST L-Trac
- Favorite switch: Beam Spring
- DT Pro Member: -
Yep, that works here in Gnome 3 as well. I can press [Right Alt][C][C][C][P] and out pops a ☭.zslane wrote: ↑Yes, that is generally what R-Alt is used for these days if you have an international keyboard layout running. If your default keyboard layout under Window, for instance, is English US, then just add the US International layout, and when that is active, the R-Alt key becomes an Alt Graph key and functions pretty much exactly as you are describing.
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
Please state the nature of the medical emergency your operating system.
In Windows, there's an official keyboard layout building program, which was used to create the United Kingdom International layout that I still use on one PC; this has dead key support. However, recent Windows versions (definitely 8 and 10, and maybe older) have serious bugs with keyboard layouts and they will flip back to US on a whim.
As such, my preference now is to put the dead key handling into AutoHotkey as part of my standard file. I needed AutoHotkey anyway to add custom symbols to (e.g. →, and real minus −), and to extend United Kingdom International with common symbols (the developer of which never responds) and since Windows is broken I figured I'd just use AutoHotkey entirely going forward.
This is all I have right now:
I'll add more in time as I find the need.
I got the idea off the Web somewhere, but I've adapted it to make it cleaner and simpler as well as handle errors better. å is only there because I know someone living in Umeå.
In Windows, there's an official keyboard layout building program, which was used to create the United Kingdom International layout that I still use on one PC; this has dead key support. However, recent Windows versions (definitely 8 and 10, and maybe older) have serious bugs with keyboard layouts and they will flip back to US on a whim.
As such, my preference now is to put the dead key handling into AutoHotkey as part of my standard file. I needed AutoHotkey anyway to add custom symbols to (e.g. →, and real minus −), and to extend United Kingdom International with common symbols (the developer of which never responds) and since Windows is broken I figured I'd just use AutoHotkey entirely going forward.
This is all I have right now:
Code: Select all
^!/::deadkey({ a: "á", e: "é", i: "í", o: "ó", u: "ú" })
^!\::deadkey({ a: "à", e: "è", i: "ì", o: "ò", u: "ù" })
^!.::deadkey({ a: "å" })
^!;::deadkey({ a: "ä", e: "ë", i: "ï", o: "ö", u: "ü", y: "ÿ" })
deadkey(keys) {
Input, key, L1, {esc}{backspace}
if (!InStr(ErrorLevel, "EndKey:"))
{
outKey := keys[key] ? keys[key] : "?"
Send %outKey%
}
return
}
I got the idea off the Web somewhere, but I've adapted it to make it cleaner and simpler as well as handle errors better. å is only there because I know someone living in Umeå.
-
- Location: Stockholm, Sweden
- DT Pro Member: 0011
Many European layouts have "dead keys" for diacritic marks that work that way. In Swedish these are '` (accents) and "^~ (umlaut, roof, tilde) and those are only those that are printed on keycaps - there might be more on Alt Gr combinations.ArtoriasEdgeworth wrote: ↑Press the diacritic key, then press the letter you want the diacritic over. Then, type the character you want the diacritic to be.
For instance, ' followed by e becomes é when you press the E key.
If you'd press the Space bar instead of a letter you'd get the symbol representing the diacritic mark on its own. For instance, Alt Gr + "^~ followed by Space is how you type ~ (tilde).
You could get this functionality by making your own custom keymap in a layout editor.
In X under Unix/Linux, you could have changes to your keymap in an input file for the xmodmap command. Then make xmodmap with your layout file run each time you log in.
-
- Main keyboard: Macbook Pro built-in :P
- Main mouse: Kensington Orbit trackball
- Favorite switch: Buckling spring
- DT Pro Member: -
As @Findecanor mentioned, this functionality is called a "dead key", and have been in use for as long as computers have the capability to display international alphabets. It has fallen out of favor on national keyboard layouts, as it makes typing slow and uncomfortable, but it is generally kept around to type foreign names and occasional words in an international context.
Actually, in Mac OS, the built-in "US International" keyboard layout has a number of so-called dead keys which do just this. In Linux, there are a number of X11 keyboard layouts that use dead keys too. Both OSes have a human writeable keyboard layout definition format that you can use to define your own dead key sequences, though it's slow and painful work. Like, "Cinderella, while we go to the ball, you code a dead key layout for typing German, Hungarian, Czech and Scandinavian names on an ANSI keyboard" slow and painful, and at least on Mac OS the only existing tool (one called Ukelele) is actually worse than writing the damn things by hand.
Actually, in Mac OS, the built-in "US International" keyboard layout has a number of so-called dead keys which do just this. In Linux, there are a number of X11 keyboard layouts that use dead keys too. Both OSes have a human writeable keyboard layout definition format that you can use to define your own dead key sequences, though it's slow and painful work. Like, "Cinderella, while we go to the ball, you code a dead key layout for typing German, Hungarian, Czech and Scandinavian names on an ANSI keyboard" slow and painful, and at least on Mac OS the only existing tool (one called Ukelele) is actually worse than writing the damn things by hand.
-
- Location: Sioux Falls, SD, US
- Main keyboard: Clueboard 66/Zilents/Originative
- Main mouse: Razer Naga 2014
- Favorite switch: Zealencioed Zilents, 45g
- DT Pro Member: -
Bonus points for the Starcraft reference, Mr. Beardsmore!
Is there any way for a keyboard controller to be programmed with this ability?
I was looking at ASCII codes, and it looks like I could program a controller to convert those three keypresses into a diacritic'd character.
Is there any way for a keyboard controller to be programmed with this ability?
I was looking at ASCII codes, and it looks like I could program a controller to convert those three keypresses into a diacritic'd character.
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
Starcraft … ??
-
- Location: Sioux Falls, SD, US
- Main keyboard: Clueboard 66/Zilents/Originative
- Main mouse: Razer Naga 2014
- Favorite switch: Zealencioed Zilents, 45g
- DT Pro Member: -
....or not.
It's something your medics can occasionally say.
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
It's from Star Trek: Voyager. Mostly entertaining for the mind-blowingly, truly incomprehensibly stupid episode "Threshold".
The controller can only send the identity of the key. For example, in the UK AltGr+e = é, but the keyboard can't deliver this. The keyboard only sends AltGr + E and the OS decides how to interpret this. It's a lousy system that locks us into the mess we got into when we decided that keyboards should be as painfully limited as typewriters.
Dead keys are processed by the OS. You could implement dead keys in hardware, but you'd be constrained to the repertoire of the host's layout, and for me I won't tolerate such a limitation.
The controller can only send the identity of the key. For example, in the UK AltGr+e = é, but the keyboard can't deliver this. The keyboard only sends AltGr + E and the OS decides how to interpret this. It's a lousy system that locks us into the mess we got into when we decided that keyboards should be as painfully limited as typewriters.
Dead keys are processed by the OS. You could implement dead keys in hardware, but you'd be constrained to the repertoire of the host's layout, and for me I won't tolerate such a limitation.
-
- Location: CZ
- Main keyboard: Kinesis Advantage2, JIS ThinkPad,…
- Main mouse: I like (some) trackballs, e.g., L-Trac
- Favorite switch: #vintage ghost Cherry MX Black (+ thick POM caps)
- DT Pro Member: -
Well, the keyboard doesn't even send AltGr+E. For example, showkey will output, when pressing keys labeled like that on a standard keyboard:
The software keymap translates 56 to AltGr and 18 to E on QWERTY (but F on Colemak), AltGr+E to 'ě' on my customized keymap.
It's technically possible to make the keyboard send Unicode right away, though. QMK and some other firmware supports it, but it might result in unintended behavior in some circumstances.
Code: Select all
key code 56 press
key code 18 press
key code 18 release
key code 56 release
It's technically possible to make the keyboard send Unicode right away, though. QMK and some other firmware supports it, but it might result in unintended behavior in some circumstances.
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
Not literally AltGr+E, if you're going to be that pedantic. Scancodes tend to be linked to their US functions, although in which case it's Right Alt+E.
-
- Location: CZ
- Main keyboard: Kinesis Advantage2, JIS ThinkPad,…
- Main mouse: I like (some) trackballs, e.g., L-Trac
- Favorite switch: #vintage ghost Cherry MX Black (+ thick POM caps)
- DT Pro Member: -
We could've been using coordinates from ISO/IEC 9995 instead.
- vvp
- Main keyboard: Katy/K84CS
- Main mouse: symetric 5-buttons + wheel
- Favorite switch: Cherry MX
- DT Pro Member: -
Translation of key presses to unicode code points is a responsibility of the keyboard driver in your operating system. You cannot do this in the keyboard controller. Well you could, but then you would need to write a special driver for your operating system.ArtoriasEdgeworth wrote: ↑ I was looking at ASCII codes, and it looks like I could program a controller to convert those three keypresses into a diacritic'd character.
Look at chapter 10 Keyboard/Keypad Page (0x07) on page 53 of USB HID Usage Tables to get an idea what a standard USB keyboard can send to an operating system.
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
Not sure if mentioned, maybe it will be useful for anyone: https://github.com/samhocevar/wincompose
-
- Location: Sioux Falls, SD, US
- Main keyboard: Clueboard 66/Zilents/Originative
- Main mouse: Razer Naga 2014
- Favorite switch: Zealencioed Zilents, 45g
- DT Pro Member: -
Thanks for the sheet, vvp. I'm gonna have to keep a copy of that handy!
I'll do some research on QMK, see what I can make happen.
I'll do some research on QMK, see what I can make happen.
-
- Location: Spain
- DT Pro Member: -
I use the US International layout for my ANSI keyboard, but I have adapted it to suit my needs using Autohotkey. So, for instance, I've mapped the Spanish ñ to the right control (or menu or right window key) and some combinations are changed so that they are easy to remember and more intuitive. So, for instance, ralt + e = €, ralt + l = £, ralt + u = ü... and several more. With my script I also changed the behaviour of the `/~, " and ^ keys to work as non-dead keys, because I do not need that behaviour in Spanish. Finally, I also figured out an alternative way to generate certain characters such as the ñ or the ü in a tablet/cell phone way, that is, keeping the n or the u key pressed for some 0,25 seconds.
- fruitalgorithm
- Location: Germany
- Main keyboard: Matias Ergo Pro
- Main mouse: Kensington Expert Mouse Wireless
- Favorite switch: Topre 45g
- DT Pro Member: -
The keeping a key pressed to get the diacritics is what macOS has done since a couple of versions. It's not bad, but it kind of interrupts the flow when touch typing. Still pretty useful to keep the number of symbols down you have to remember when using an unfamiliar layout.