Windows 8: Add German umlauts to US keyboard layout (maybe using AutoHotKey)

6,177

Solution 1

I see that the other answer was already selected, but here is my personal solution. I created a number of hotstrings. e.g. "a will give ä

:?C*:``a::à
:?C*:``i::ì
:?C*:``e::è
:?C*:``o::ò
:?C*:``u::ù
:?C*:``A::À
:?C*:``I::Ì
:?C*:``E::È
:?C*:``O::Ò
:?C*:``U::Ù

:?C*:^ :: ; Turn ^{Space} into neutral ^, else ^ will be used in next vowel.
    Send, {^}{Space}{BackSpace}
Return

:?C*:^a::â
:?C*:^i::î
:?C*:^e::ê
:?C*:^o::ô
:?C*:^u::û
:?C*:^A::Â
:?C*:^I::Î
:?C*:^E::Ê
:?C*:^O::Ô
:?C*:^U::Û


:?C*:`" :: ; Turn "{Space} into neutral ", else " will be used in next vowel.
    Send, +{'}{Space}{BackSpace}
Return

:?C*:`"a::ä
:?C*:`"i::ï
:?C*:`"e::ë
:?C*:`"o::ö
:?C*:`"u::ü
:?C*:`"A::Ä
:?C*:`"I::Ï
:?C*:`"E::Ë
:?C*:`"O::Ö
:?C*:`"U::Ü

:?C*:' :: ; Turn '{Space} into neutral ', else ' will be used in next vowel.
    Send, {'}{Space}{BackSpace}
Return

:?C*:`'a::á
:?C*:`'i::í
:?C*:`'e::é
:?C*:`'o::ó
:?C*:`'u::ú
:?C*:`'A::Á
:?C*:`'I::Í
:?C*:`'E::É
:?C*:`'O::Ó
:?C*:`'U::Ú

:?C*:`'c::ç
:?C*:`'C::Ç
:?C*:ss\::ß
:?C*:ae\::æ
:?C*:AE\::Æ
:?C*:oe\::œ
:?C*:OE\::Œ

Solution 2

Inspired by the last post, I figured out an additional solution, as the above sometimes caused problems while writing.

  1. I first remapped CapsLock to RShift as I always use the LShift key for capital anyway
  2. Setup the mapping

Rshift & a::
{
  GetKeyState, state, Lshift
  if state = D
    sendinput, Ä
  else
    sendinput, ä    
  return
}

Rshift & o::
{
  GetKeyState, state, Lshift
  if state = D
    sendinput, Ö
  else
    sendinput, ö    
  return
}

Rshift & u::
{
  GetKeyState, state, Lshift
  if state = D
    sendinput, Ü
  else
    sendinput, ü
  return
}

Rshift & s::
{
  sendinput, ß
  return
}

Rshift & e::
{
  sendinput, €
  return
}
Share:
6,177
pederpansen
Author by

pederpansen

Updated on September 18, 2022

Comments

  • pederpansen
    pederpansen over 1 year

    I just realized that the Microsoft Keyboard Layout Creator does not work anymore under Windows 8. I used it successfully under Windows 7 to create a custom keyboard layout on top of a US layout, where I additionally added AltGr+a, AltGr+o, AltGr+u for the corresponding umlauts ä, ö and ü.

    I now want to do the same in Windows 8, with the additional difficulty that my new laptop does not have any AltGr key, but only ONE Crtl and ONE Alt key, and the corresponding combinations with a, o and u are pretty much taken. So I wondered if I could use AutoHotKey to create hotkeys for Space+a, Space+o and Space+u. This is how far I got:

    ~space & a::
    Send ä
    

    This script will map Space+a to the correct umlaut, and the ampersand will make sure you can still use the space key when not using this hotkey. However, this will always insert a space in front of the 'ä'. In addtion, a fast succession of the keys Space and a will also yield an umlaut, when I actually wanted to type ' a'.

    I am looking for a solution that will insert the single characters without any spaces when the corresponding hotkey is pressed, and that does not have any effect otherwise, meaning successive (as opposed to simultaneous) pressing of Space and {a,o,u} will not do anything. Furthermore, it should not mess with system-wide hotkeys like Windows+Space for switching the input language. If this can be done without AutoHotKey, I will happily accept that solution as well.

    • pederpansen
      pederpansen over 10 years
      I figured the Keyboard Layout Creator actually DOES work, but you will need to restart to activate the new layout after installation. However, you can only use Ctrl, Shift and Alt as hotkey modifiers, and I like the AutoHotKey solution using the space bar better.
  • pederpansen
    pederpansen over 9 years
    Sorry for my late response. This is a great script, it works really well. Due to my lack of reputation I can't even upvote it. Thanks for sharing!