Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
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 Nov 22 '13 at 9:41
    
Thank you for the late reply. –  Robert Ilbrink Oct 18 at 19:16

4 Answers 4

up vote 1 down vote accepted

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\::Œ
share|improve this answer
    
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! –  pederpansen Oct 18 at 15:40

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|improve this answer
    
I also noticed that using space as a hotkey is not a good idea in general. My own answer below used to work for some time, but recently it started crashing. Using right shift is an easy and effective workaround. –  pederpansen Oct 20 at 7:38

You could also use the bit longer but standard keys Alt + 132 = ä Alt + 137 (or 0235) = ë Alt + 139 (or 0239) = ï Alt + 148 (or 0246) = ö Alt + 129 (or 0252) = ü

share|improve this answer

Feels weird answering my own question, but since nobody else had an idea, I figured it out myself. The following AutoHotKey script does the trick:

#SingleInstance force

~space & a::
{
  GetKeyState, state, Shift
  if state = D
    sendinput, {backspace 1}Ä
  else
    sendinput, {backspace 1}ä

  return
}

~space & o::
{
  GetKeyState, state, Shift
  if state = D
    sendinput, {backspace 1}Ö
  else
    sendinput, {backspace 1}ö
  return
}

~space & u::
{
  GetKeyState, state, Shift
  if state = D
    sendinput, {backspace 1}Ü
  else
    sendinput, {backspace 1}ü
  return
}

~space & s::
{
  sendinput, {backspace 1}ß
  return
}

~space & e::
{
  sendinput, {backspace 1}€
  return
}

The crucial part is using the backspace function, which deletes the space when one of the hotkey cases was activated. Also, checking for the state of the shift key enables case-sensitive character insertion. For convenience, I also added hotkeys for the German "sharp s" (which only exists in lower case) and the Euro symbol.

Please make sure to start this script at logon with admin rights, following the very nice instruction here.

With this script, the space key functions as before, and only in the case of pressing it together with one of the keys a, o, u, s or e, it does something special, which is the solution I was looking for.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.