9

I've recently switched from Windows to Ubuntu 11.04, and a difference that bugs me a bit is, when a dead key (such as ^ or ´) is pressed twice, the behavior differs in the two OS'es.

On Windows, the first press is dead, but the second press gives you two characters. So, for instance, pressing ¨ once nets you nothing, but twice nets you ¨¨.

On Ubuntu, the first press is also dead, but the second press only nets you one character. So, pressing ¨ once nets you nothing, twice nets you ¨.

What I'd like to do is make dead keys function as on Windows, that is, pressing them twice nets you the character two times.

I do not wish to make them non-dead, as I then wouldn't be able to write for ü, for instance.

Is such a thing possible, and if so, how?

4
  • 2
    Just out of curiosity, I remember this behavior from my Windows days and it always boggled me what the use case could be for wanting two of them, any insight? I don't think there was a single time where I didn't use the backspace after hitting a dead key twice. Jun 20, 2011 at 10:04
  • For instance, when writing LaTeX, quoted text is written like ``this''. There's also the smiley ^^. Jun 20, 2011 at 11:07
  • 1
    I see, Kile autocorrects my " into `` or '' depending on what's needed. Jun 20, 2011 at 11:51
  • I just defined my own qq{} and q{} function for quotes. If you use a specific editor, you might be able to program that one ` will output `` or so Aug 13, 2011 at 22:23

3 Answers 3

1

You can get similar behavior with the compose key. The compose key can be set under System Settings -> Keyboard -> Layout -> Options -> Compose Key. Now, to type ü, press compose, release compose and then proceed as you would in Windows.

Edit: Misread slightly, you'd need to make the keys dead before doing this, which for me, they were by default.

0

What you're asking isn't possible as far as I know; however if you would change your keyboard-layout to one with AltGr deadkeys, you'll still be able to have your deadkeys like ü.

How to get those deadkeys is very easy; e.g. ü would be AltGr + Shift + '.

If you don't have a dedicated AltGr key, then the right Alt key would be that key.

0

What I'd like to do is make dead keys function as on Windows, that is, pressing them twice nets you the character two times.

I do not wish to make them non-dead, as I then wouldn't be able to write for ü, for instance.

I wanted the same thing and failed to find an easy way to have ubuntu behave exactly like windows (dead key, but type it twice when typed twice). The solution that I am now using for myself uses dead keys, but still allows me to type special characters that are not on my keyboard, like à.

What I need to do to write such a character is to first press the "compose key".

There are multiple ways to set a compose key, including a nice gui with gnome-tweak-tool as proposed here. But using Capslock or Right Alt really messed with my flow.

So I propose this: Set a combination as your control key. I set it to AltGrSuper and now anything I type immediately after I release these two keys will be combined into one character.

This is done as follows:

  1. Set your keyboard layout to not use dead keys
  2. Find the available options with grep "compose:" /usr/share/X11/xkb/rules/base.lst
  3. Set your preferred option using something like this command
    dconf write /org/gnome/desktop/input-sources/xkb-options "['compose:lwin-altgr']"
  1. You might have to log out and back in again
4
  • I am facing a very similar issue, only difference is that I did need to type the ` (dead_grave) only once. I don't want it to work for typing composed characters (I need it for develop code). right now I have to type twice to get a single quote. any advice? Apr 8, 2020 at 18:05
  • @cesarpachon have you tried all the keyboard layouts that are normally available? E.g. for swiss german, there are like 4 options. I might misunderstand you, but perhaps all you need is a keyboard layout that says "no dead keys"
    – lucidbrot
    Apr 8, 2020 at 18:45
  • I don't want to change the full layout, just customize a single key. I have a spanish keyboard and the dead_grave key needs to be activated with alt gr. in US keyboards it is a direct keystroke. all other keys are ok. I was able to change that behavior with xmodmap but I need yet to press twice to insert the character. I would like to press it only once for writing code. like: instead of à I want just: hello (javascript feature for interpolated strings). Thanks for your suggestion I will search for alternative layouts (I would like to preserve dead_acute for spanish: Canción) Apr 9, 2020 at 17:15
  • Hmm, okay. I would advise you to ask a new question then, @cesarpachon. I don't know how, but I'm sure that should be doable with some keybinding mapping
    – lucidbrot
    Apr 9, 2020 at 17:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .