48

In the default German keyboard layout ^ and backtick/forwardtick are deadkeys.

However, as a programmer I usually do not need to write áccênts, but the characters itself. Being required to press the key twice and backspace or the key and space is pretty annoying in this case.

So I'd like to know if (and how) it's possible to change those keys so they immediately create the character instead of waiting for a second character.

5
  • 8
    +1 programming on German Windows keyboards makes me go nuts.
    – slhck
    May 6, 2011 at 8:59
  • 2
    @slhck That's why I got several British/International layout keyboard, even in my laptops ;)
    – Daniel Beck
    May 6, 2011 at 9:56
  • 1
    I'm used to it so I don't want to change the layout. May 6, 2011 at 10:14
  • 1
    For non-German keyboards, see also When I type " nothing comes out, and if I type it again, 2 of it comes out as such: "" which explains about choosing some non-"US International" keyboard layout.
    – Arjan
    Nov 9, 2014 at 20:09
  • Not only programming, you can't use console in games like quake/half-life properly. You have to delete crap every single time you open it. Jan 28, 2017 at 20:17

3 Answers 3

45

You can use Microsoft's Keyboard Layout Creator to modify your layout. Once you've downloaded and installed, do this:

  1. Hit "File" and "Load Existing Keyboard".
  2. Dead keys are displayed as grey - with a right-click on any key, you can assign or un-assign dead key behavior:

enter image description here

  1. When you're done assigning and un-assigning, go to "Project" -> "Properties" and edit the description. "Name" has an 8-character-limit (for whatever reasons), so just set it to "Deutsch" and the description to something like "Deutsch - No Dead Keys" or whatever you fancy.

  2. When you're done, go to "Project" and choose "Build DLL and Setup Package". On creation, it will say it has some warnings in the log file, but they can probably ignored. The next prompt will ask you if you want to open the directory the files have been written to - if you do so, you can just install your layout with one click.

  3. Open Keyboard Settings in Windows to check whether the new keyboard layout has been added to Windows' list. I

Done!

4
1

I couldn't get the method based on the keyboard creator to work. Instead, I came up with an AutoHotKey script. The method for detecting the current keyboard layout is taken from How to find out what is the current keyboard layout?.

The idea is to automate sending the sequence "dead key + space". Since this will have the wrong effect for layouts without dead keys, I filter based on the locale ID, which for the German keyboard fulfills the pattern 0x0407????. This value may not be portable, given that keyboard layouts are not hardcoded.

I considered using GetKeyboardLayoutNameA, but the value sometimes is outdated.

;;;; ------ NO DEAD KEYS ------

GetCurrentLocaleId()
{
  ;; Source:
  ;;   https://autohotkey.com/board/topic/
  ;;   22900-how-to-find-out-what-is-the-current-keyboard-layout/
  WinGet, WinID,, A
  ThreadID := DllCall("GetWindowThreadProcessId", "Int", WinID, "Int", 0)
  InputLocaleID := DllCall("GetKeyboardLayout", "Int", ThreadID)
  Return InputLocaleID
}

IsGermanKbdLayout()
{
  Return GetCurrentLocaleId()//0x10000 == 0x407
}

#If IsGermanKbdLayout()
SC029::SendRaw % "^ "
SC00D::SendRaw % "´ "
+SC00D::SendRaw % "`` "
;; Find scan codes by viewing script's console > view > key history
0

FTR

If you are using the new Microsoft Terminal as your daily terminal driver (if not try it out, it's absolutely awesome), you can disable dead keys using a macro in your settings as such:

"actions":
[
    ...
    { "command": { "action": "sendInput", "input": "^" }, "keys": "^" },
    ...
]

You must log in to answer this question.

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