Вы находитесь на странице: 1из 5

How to incorporate German Umlauts on US keyboard Author: Sohail Khan (Vienna, Austria) Date: 04-01-2014

Source: http://www.autohotkey.com/board/topic/515-german-umlaute-convenience-script/ Background: ======== Some countries, like Germany, use Umlaut keys, e.g. etc. with special adopted keyboard layouts. However, IMHO there is no shadow of a doubt that US English keyboard layouts have the highest usability and efficiency for typing code and for reaching the most common shortcuts. Just look at the loops you have to jump through to reproduce [] {} /\ on German keyboards. It's ridiculous. Well, you could use an English US layout and just type "ue" instead of or ss instead of etc. and try to get along. This is fine for most correspondence and documents, but I deem it inappropriate in the "business world". So what to do, instead? You could install both keyboard layouts on one physical keyboard. There is a default shortcut (ALT+SHIFT) to quickly swap between those 2 layouts. Unfortunately, this will result in many typing mistakes because the layouts differ quite a lot. Once you get used where to find your [z],[:],[(],[)],... and whatnot, you are well quite used to it. Alternatively, there is the option of installing an US English International keyboard layout. It works somewhat but very painfully so. Here you have a special UMLAUTKEY which is ["], and cannot be changed. So you'd type ["] and then [u] to get . However for the you have to press [Ctrl]+[Alt]+s. Why they didn't just use ["] + s is beyond me. Additionally, ["] is a dumb frequently needed triggerkey because it requires two keypresses ([SHIFT]+[']) even on US English keyboard layouts. To cut it short, there is no good solution for this misery out there. Until now. I decided to write something on my own. Idea: === When you write an by hand on paper, you first write an u and then add the two little dots. This is why I think it's much more intuitive to press the UMLAUTKEY after hitting u,a,o,s. This UMLAUTKEY should be easily reachable and not require another [SHIFT] operation. Of course the UMLAUTKEY should be the same for all Umlaute. No different handling for or . In Germany you need the following 7 "Umlaute"

a -> A -> u -> U -> o -> O -> s -> I defined [1] as the Umlautkey and a delay of one second. That is you have to press [1] within DELAY seconds (=1, default) to get your Umlaut. Otherwise you will get e.g. u1, ... I took great care to write the script in such a way that it won't influence typing speed in any way. The only problems are words which end with a potential umlaut and a "1" . But this is rather rare and can be redefined easily. Ideally, I would want the UMLAUTKEY to be [ALT] or something, which is why I requested InputAnyKey in the "WishList" forum. The script can be easily adopted to any language which uses Umlauts, be it French or whatever. Feel free to do so. Big thanks again to Chris for putting together this hell of a tool. I'm glad I didn't have to write my own keyboard proxy filter software and could just use the powerful scripting language of AutoHotKey. This has made my life in the business world much easier. Without further ado, here the script: Script: (copy the script from URL if available otherwise use copy the following in a text file and use it as script)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; German Umlaute Convenience Script ;; ;; for Superior US English Keyboard Layouts ;; ;; ;; ;; version 0.3 - 07/18/04 ;; ;; ck <use www.autohotkey.com forum to contact me> ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Usage Instructions: ;; ------------------;; Load Script into AutoHotKey (only verified to work with 1.0.15 and Windows XP) ;; a) Press any of the TRIGGERKEYS [u,U,a,A,o,O,s] in any application of your choice ;; b) Within DELAY seconds, press the UMLAUTKEY to morph it into [,,,,,,]

; after pressing a TRIGGERKEY, you have to wait DELAY seconds to press the UMLAUTKEY ; and make it appear normally (without triggering any Umlaut morphing) DELAY = 1.0 ; default = 1 UMLAUTKEY = 1 ; default = 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; You shouldn't have to edit below this line ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;#NoTrayIcon ; remember the latest activated Umlaut UMLAUT = x $u:: ; Above: Use the $ to force the hook to be used, which prevents an ; infinite loop since this subroutine itself sends Numpad0, which ; would otherwise result in a recursive call to itself. ; mirror self Send, u ; initialize current Umlaut UMLAUT = Goto, WaitForUK $+u:: Send, U UMLAUT = Goto, WaitForUK $o:: Send, o UMLAUT = Goto, WaitForUK $+o:: Send, O UMLAUT = Goto, WaitForUK $a:: Send, a UMLAUT = Goto, WaitForUK $+a:: Send, A UMLAUT = Goto, WaitForUK

$s:: Send, s UMLAUT =

WaitForUK: ; disable this and every other TRIGGERKEY to speed things up Hotkey, $u, Off Hotkey, $+u, Off Hotkey, $o, Off Hotkey, $+o, Off Hotkey, $a, Off Hotkey, $+a, Off Hotkey, $s, Off ; Most editors can handle the fastest speed (-1) SetKeyDelay, 0 ; 0 for reliability ; repeat until EITHER the UMLAUTKEY was hit or any other key breaking the sequence (non TRIGGERKEY) Loop { ; watch next input string (only wait for exactly one char, mirror input, ignore backspace and wait DELAY seconds) Input, UserInput, V L1 B T%DELAY% if UserInput = %UMLAUTKEY% { Send, {backspace 2}%UMLAUT% break } else if UserInput = u UMLAUT = else if UserInput = o UMLAUT = else if UserInput = +o UMLAUT = else if UserInput = a UMLAUT = else if UserInput = A UMLAUT = else if UserInput = s UMLAUT = else break } ; re-enable all initial Umlaut TRIGGERKEYS Hotkey, $u, On

Hotkey, $+u, On Hotkey, $o, On Hotkey, $+o, On Hotkey, $a, On Hotkey, $+a, On Hotkey, $s, On ; finish this hotkey handling routine return ==================================== Use following video to get acquainted with the authohotkey http://www.youtube.com/watch?v=UD_mry_DN-s Note: You need to save your script with .ahk extension for example mysript.ahk How do I put my hotkeys and hotstrings into effect automatically every time I start my PC? There is a folder in the Start Menu called Startup. If you put a shortcut to your script in that folder, the script will launch automatically every time you start your PC. To create a shortcut: 1. Find the script file, select it, and press Control-C. 2. Right-click the Start button (typically at the lower left corner of the screen) and choose "Explore All Users". 3. Navigate to the Startup folder inside the Programs folder. ============ How to ======================= Paste %AppData% in the Run box and select Ok. This will generate your AppData folder structure which will appear in the address bar. Paste the following code after what is generated in the address bar: \Microsoft\Windows\Start Menu\Programs\Startup In My case its C:\Users\Sohail Khan\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

4. From the menu bar, choose Edit -> Paste Shortcut. The shortcut to the script should now be in the Startup folder.

Вам также может понравиться