45

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.

Michał Leon
  • 173
  • 1
  • 9
ThiefMaster
  • 6,007
  • 9
  • 36
  • 43
  • 7
    +1 programming on German Windows keyboards makes me go nuts. – slhck May 06 '11 at 08:59
  • 2
    @slhck That's why I got several British/International layout keyboard, even in my laptops ;) – Daniel Beck May 06 '11 at 09:56
  • 1
    I'm used to it so I don't want to change the layout. – ThiefMaster May 06 '11 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: ""](http://superuser.com/questions/288003/when-i-type-nothing-comes-out-and-if-i-type-it-again-2-of-it-comes-out-as-su) which explains about choosing some non-"US International" keyboard layout. – Arjan Nov 09 '14 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. – Smit Johnth Jan 28 '17 at 20:17

3 Answers3

44

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!

flederwiesel
  • 105
  • 5
Tobias Plutat
  • 5,535
  • 1
  • 24
  • 19
  • 15
    To all the German programmers: While you're in there, change the numpad decimal separator to `.`. – Oliver Salzburg Apr 30 '12 at 09:50
  • 2
    For your convenience, I published a version of the German keyboard layout without dead keys [on GitHub](https://github.com/RAnders00/Deutsch-ohne-Tottasten/releases) for you to download and install. – randers Jun 04 '16 at 11:42
  • @OliverSalzburg and caps lock should only work with letters, not with digits. – Smit Johnth Jan 28 '17 at 21:18
  • See also http://freeman2222.mywebcommunity.org/us-intnd.zip for a ready-made non-dead-key keyboard installation. Based on US_international. Found at https://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/disable-dead-keys-for-us-international-keyboard/1de44160-83d9-4cd8-9eb3-e6b06b8604a4 – parvus Oct 12 '17 at 08:59
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
kdb
  • 2,080
  • 1
  • 26
  • 43
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": "^" },
    ...
]
Cukic0d
  • 103
  • 4