Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Script for German umlauts changing


  • Please log in to reply
3 replies to this topic
Kamik
  • Members
  • 2 posts
  • Last active: Sep 20 2012 04:44 PM
  • Joined: 20 Sep 2012
Hello, guys.
I was looking for the solution to my problem with entering German umlauts using English keyboard setting.
So I found it on one of the programming forums, where I got the following script for AutoHotkey:

!sc012::Send, {ASC 0228} ; Alt+E, а-lower case umlaut
#!sc012::Send, {ASC 0196} ; Win+Alt+E, а-initial umlaut
!sc01F::Send, {ASC 0246} ; Alt+S, о-lower case umlaut
#!sc01F::Send, {ASC 0214} ; Win+Alt+S, о-initial umlaut
!sc02C::Send, {ASC 0252} ; Alt+Z, u-lower case umlaut
#!sc02C::Send, {ASC 0220} ; Win+Alt+Z, u-initial umlaut
!sc010::Send, {ASC 0223} ; Alt+Q, Eszett

Can I change the script and change the Alt+E combination for Alt+A to get ä , Alt+S for Alt+O to get ö , and Win+Alt+E for Shift+Alt+A to get Ä, for instance (and so on for all of them to get the correspondence between the pressed keys and the final result.
My brain is not of a programmer kind at all, so could you please help me.

Kamik
  • Members
  • 2 posts
  • Last active: Sep 20 2012 04:44 PM
  • Joined: 20 Sep 2012
Well, I've done it on my own when found the keys layout.
Admin, you can delete the topic.

swissfish10
  • Members
  • 2 posts
  • Last active: Sep 21 2014 01:01 PM
  • Joined: 20 Sep 2014

Hi All,

 

I'm not a super user of ahk, but do find it useful. I've been scouring the forums trying to find a way to put the CapsLock key to good use, namely to use it as a modifier when I press the a, o, u and s keys, to give ä, ö, ü and ß. I also wanted to combine it with the Shift keys, to produce upper case ä, ö and ü. Thanks to you guys (as well as snitzr at Superuser http://superuser.com...with-autohotkey) I've come up with a really useful script)

;Umlaut
#Persistent
SetCapsLockState, AlwaysOff
	
	CapsLock & a:: 
		GetKeyState, state, Shift
		if state = U
		SendInput {ASC 0228}			;CapsLock+a = lower case a-umlaut
		else Send, {ASC 0196}			;CapsLock+Shift+a = UPPER CASE A-umlaut
	return
	
	CapsLock & o:: 
		GetKeyState, state, Shift
		if state = U
		SendInput {ASC 0246}			;CapsLock+o = lower case o-umlaut
		else Send, {ASC 0214}			;CapsLock+Shift+o = UPPER CASE O-umlaut
	return
	
	CapsLock & u:: 
		GetKeyState, state, Shift
		if state = U
		SendInput {ASC 0252}			;CapsLock+u = lower case u-umlaut
		else Send, {ASC 0220}			;CapsLock+Shift+u = UPPER CASE U-umlaut
	return
	
	CapsLock & s:: Send, {ASC 0223}		;CapsLock+s = CapsLock+s, Eszett
	return

There is probably a more elegant solution out there, but I spent my whole afternoon to finally come up with this! And it works really well. So, now I can type away on my US Layout Keyboard and punch in german characters on the fly. So much better than copy and pasting. And the CapsLock key has a useful function to boot!

 

Cheers.



Oldman
  • Members
  • 2475 posts
  • Last active: Feb 18 2015 04:57 PM
  • Joined: 01 Dec 2013

What about this ?

;Umlaut
#Persistent
SetCapsLockState, AlwaysOff

#If, GetKeyState("CapsLock", "P")
a::Send, ä
o::Send, ö
u::Send, ü
s::Send, ß		;CapsLock+s = CapsLock+s, Eszett
+a::Send, Ä
+o::Send, Ö
+u::Send, Ü
#If

Don't forget to save the script in utf-8 with BOM.


Si ton labeur est dur et que tes résultats sont minces, souviens toi du grand chêne qui avant n'était qu'un gland....comme toi ! (anonyme) ;)

L'art de lire, c'est l'art de penser avec un peu d'aide. (É. Faguet)

Windows 3.1. Collector's Edition.     (www.avaaz.org)