This repository has been archived by the owner on Jun 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompose.au3
65 lines (57 loc) · 1.55 KB
/
Compose.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <Misc.au3>
#include <MsgBoxConstants.au3>
; Only run this script once
If _Singleton("Compose", 1) = 0 Then
Exit
EndIf
HotKeySet("{CAPSLOCK}", "ComposeFunction")
While 1
Sleep(100)
Wend
Func ComposeFunction()
HotKeySet('"', "UmlautsFunction")
HotKeySet("s", "Compose_s")
EndFunc
Func UmlautsFunction()
HotKeySet("a", "SendComposeUmlauts")
HotKeySet("o", "SendComposeUmlauts")
HotKeySet("u", "SendComposeUmlauts")
HotKeySet("A", "SendComposeUmlauts")
HotKeySet("O", "SendComposeUmlauts")
HotKeySet("U", "SendComposeUmlauts")
HotKeySet('"') ; Unset umlauts prefix hotkey
HotKeySet("s") ; Unset ß hotkey
EndFunc
Func SendComposeUmlauts()
Select ; The last hotkey pressed
Case @HotKeyPressed == "a"
Send("ä", 1)
Case @HotKeyPressed == "o"
Send("ö", 1)
Case @HotKeyPressed == "u"
Send("ü", 1)
Case @HotKeyPressed == "A"
Send("Ä", 1)
Case @HotKeyPressed == "O"
Send("Ö", 1)
Case @HotKeyPressed == "U"
Send("Ü", 1)
EndSelect
; Remove hotkeys
HotKeySet("a")
HotKeySet("o")
HotKeySet("u")
HotKeySet("A")
HotKeySet("O")
HotKeySet("U")
EndFunc
Func Compose_s()
HotKeySet('"') ; Unset umlaut hotkeys
HotKeySet("s") ; Make sure that “s” hotkey doesn’t stack
HotKeySet("s", "SendCompose_ss")
EndFunc
Func SendCompose_ss()
Send("ß", 1)
; Remove hotkey
HotKeySet("s")
EndFunc