neo-layout/windows/neo-vars/src/tools.ahk

632 lines
22 KiB
AutoHotkey
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; -*- encoding: utf-8 -*-
; Römische Zahlen
LoadToolComposeRoman() {
global
CMS__Comp := 1
CMS__CompU000072 := 1
CMS__CompU000052 := 1
CDS__CompU000072U00004F := "P__Rom1"
;CDS__CompU000072U000031 := "P__Rom1"
;CDS__CompU000052U000031 := "P__Rom1"
CDS__CompU000052U00004F := "P__Rom2"
;CDS__CompU000072U000032 := "P__Rom2"
;CDS__CompU000052U000032 := "P__Rom2"
CDS__CompU000072U00006F := "P__Rom3"
;CDS__CompU000072U000033 := "P__Rom3"
;CDS__CompU000052U000033 := "P__Rom3"
CDS__CompU000052U00006F := "P__Rom4"
;CDS__CompU000072U000034 := "P__Rom4"
;CDS__CompU000052U000034 := "P__Rom4"
}
GUISYM("P__Rom1","","t")
GUISYM("P__Rom2","","t")
GUISYM("P__Rom3","vii","t")
GUISYM("P__Rom4","VII","t")
CharProc__Rom1() {
global
; starte klein geschriebene römische Zahlen, verwende U2160++
PressHookProc := "Roman"
RomanMode := 1
RomanSum := 0
}
CharProc__Rom2() {
global
; starte groß geschriebene römische Zahlen, verwende U2160++
PressHookProc := "Roman"
RomanMode := 2
RomanSum := 0
}
CharProc__Rom3() {
global
; starte klein geschriebene römische Zahlen, verwende Buchstaben
PressHookProc := "Roman"
RomanMode := 3
RomanSum := 0
}
CharProc__Rom4() {
global
; starte groß geschriebene römische Zahlen, verwende Buchstaben
PressHookProc := "Roman"
RomanMode := 4
RomanSum := 0
}
GenRomanDigit(Pos, DigitIs, DigitTest, str0, str1, str2, str3, str4, str5) {
res := ""
if (DigitIs == DigitTest)
res := util_char2UCode(str%Pos%)
return res
}
PressHookRoman(PhysKey, ActKey, Char) {
global
if (SubStr(Char,1,1) == "P")
CharStarDown(PhysKey, ActKey, Char)
else if ((Char == "U000030") or (Char == "S__N__0"))
RomanSum := 10*RomanSum
else if ((Char == "U000031") or (Char == "S__N__1"))
RomanSum := 10*RomanSum + 1
else if ((Char == "U000032") or (Char == "S__N__2"))
RomanSum := 10*RomanSum + 2
else if ((Char == "U000033") or (Char == "S__N__3"))
RomanSum := 10*RomanSum + 3
else if ((Char == "U000034") or (Char == "S__N__4"))
RomanSum := 10*RomanSum + 4
else if ((Char == "U000035") or (Char == "S__N__5"))
RomanSum := 10*RomanSum + 5
else if ((Char == "U000036") or (Char == "S__N__6"))
RomanSum := 10*RomanSum + 6
else if ((Char == "U000037") or (Char == "S__N__7"))
RomanSum := 10*RomanSum + 7
else if ((Char == "U000038") or (Char == "S__N__8"))
RomanSum := 10*RomanSum + 8
else if ((Char == "U000039") or (Char == "S__N__9"))
RomanSum := 10*RomanSum + 9
else if ((Char == "U00000D") or (Char == "U000020")) {
RomanSum := mod(RomanSum,400000)
RomanStr := ""
RomanPos := 0
if (RomanMode == 1)
loop {
RomanDigit := mod(RomanSum,10)
RomanSum := RomanSum//10
RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"","","","","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"","","","ⅿⅿ","ↂↂ","ↈↈ") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"","","","ⅿⅿⅿ","ↂↂↂ","ↈↈↈ") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"","","","ↀↁ","ↂↇ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"","","","","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"","","","ↁↀ","ↇↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"","","","ↁↀↀ","ↇↂↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"","","","ↁↀↀↀ","ↇↂↂↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"","","ⅽⅿ","ↀↂ","ↂↈ","") . RomanStr
if (RomanSum == 0)
break
RomanPos := RomanPos + 1
}
else if (RomanMode == 2)
loop {
RomanDigit := mod(RomanSum,10)
RomanSum := RomanSum//10
RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"","","","","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"","","","","ↂↂ","ↈↈ") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"","","","","ↂↂↂ","ↈↈↈ") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"","","","Ⅿↁ","ↂↇU002182U002187","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"","","","","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"","","","ↁⅯ","ↇↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"","","","ↁⅯⅯ","ↇↂↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"","","","ↁⅯⅯⅯ","ↇↂↂↂ","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"","","","Ⅿↂ","ↂↈ","") . RomanStr
if (RomanSum == 0)
break
RomanPos := RomanPos + 1
}
else if (RomanMode == 3)
loop {
RomanDigit := mod(RomanSum,10)
RomanSum := RomanSum//10
RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"i" ,"x" ,"c" ,"m" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"ii" ,"xx" ,"cc" ,"mm" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"iii" ,"xxx" ,"ccc" ,"mmm","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"iv" ,"xl" ,"cd" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"v" ,"l" ,"d" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"vi" ,"lx" ,"dc" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"vii" ,"lxx" ,"dcc" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"viii","lxxx","dccc","" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"ix" ,"xc" ,"cm" ,"" ,"","") . RomanStr
if (RomanSum == 0)
break
RomanPos := RomanPos + 1
}
else if (RomanMode == 4)
loop {
RomanDigit := mod(RomanSum,10)
RomanSum := RomanSum//10
RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"I" ,"X" ,"C" ,"M" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"II" ,"XX" ,"CC" ,"MM" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"III" ,"XXX" ,"CCC" ,"MMM","","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"IV" ,"XL" ,"CD" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"V" ,"L" ,"D" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"VI" ,"LX" ,"DC" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"VII" ,"LXX" ,"DCC" ,"" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"VIII","LXXX","DCCC","" ,"","") . RomanStr
RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"IX" ,"XC" ,"CM" ,"" ,"","") . RomanStr
if (RomanSum == 0)
break
RomanPos := RomanPos + 1
}
loop {
if (RomanStr == "")
break ; erledigt
CharOut(SubStr(RomanStr,1,7))
RomanStr := SubStr(RomanStr,8)
}
PressHookProc := ""
} else
PressHookProc := ""
}
; Unicode <> Hex converter
LoadToolComposeUni() {
global
CMS__CompU000075 := 1
CMS__CompU000055 := 1
CDS__CompU000075U000075 := "P___Uni"
CDS__CompU000075U000055 := "P___Uni"
CDS__CompU000055U000075 := "P___Uni"
CDS__CompU000055U000055 := "P___Uni"
CMS__CompU000064 := 1
CMS__CompU000044 := 1
CDS__CompU000064U000064 := "P__DUni"
CDS__CompU000064U000044 := "P__DUni"
CDS__CompU000044U000064 := "P__DUni"
CDS__CompU000044U000044 := "P__DUni"
}
EDSKUpdate("u","P___Uni",5)
GUISYM("P___Uni","UU","t")
GUISYM("P__DUni","DD","t")
CharProc___Uni() {
global
; starte Unicode-Hex-in-Zeichen-Umwandlung
PressHookProc := "Uni"
UniSum := ""
}
CharProc__DUni() {
global
; starte Unicode-Zeichen-in-Hex-Umwandlung
CharOutFilterProc := "DUni"
}
PressHookUni(PhysKey, ActKey, Char) {
global
if (SubStr(Char,1,1) == "P")
CharStarDown(PhysKey, ActKey, Char)
else if ((Char == "U000030") or (Char == "S__N__0"))
UniSum := UniSum . "0"
else if ((Char == "U000031") or (Char == "S__N__1"))
UniSum := UniSum . "1"
else if ((Char == "U000032") or (Char == "S__N__2"))
UniSum := UniSum . "2"
else if ((Char == "U000033") or (Char == "S__N__3"))
UniSum := UniSum . "3"
else if ((Char == "U000034") or (Char == "S__N__4"))
UniSum := UniSum . "4"
else if ((Char == "U000035") or (Char == "S__N__5"))
UniSum := UniSum . "5"
else if ((Char == "U000036") or (Char == "S__N__6"))
UniSum := UniSum . "6"
else if ((Char == "U000037") or (Char == "S__N__7"))
UniSum := UniSum . "7"
else if ((Char == "U000038") or (Char == "S__N__8"))
UniSum := UniSum . "8"
else if ((Char == "U000039") or (Char == "S__N__9"))
UniSum := UniSum . "9"
else if ((Char == "U000041") or (Char == "U000061"))
UniSum := UniSum . "A"
else if ((Char == "U000042") or (Char == "U000062"))
UniSum := UniSum . "B"
else if ((Char == "U000043") or (Char == "U000063"))
UniSum := UniSum . "C"
else if ((Char == "U000044") or (Char == "U000064"))
UniSum := UniSum . "D"
else if ((Char == "U000045") or (Char == "U000065"))
UniSum := UniSum . "E"
else if ((Char == "U000046") or (Char == "U000066"))
UniSum := UniSum . "F"
else if ((Char == "U00000D") or (Char == "U000020")) {
UniSum := "U" . SubStr("000000" . UniSum, -7)
PP%PhysKey% := UniSum
PR%PhysKey% := UniSum
CharOutDown(UniSum)
PressHookProc := ""
} else
PressHookProc := ""
}
CharOutFilterDUni(char,down,up) {
global
if (!down or char == "S__L_M2" or char == "S__R_M2")
return char
CharOutFilterProc := ""
dchar := char
if (substr(dchar,1,3) == "U00")
dchar := "U" . substr(dchar,4)
TrayTip,Unicode-Zeichen,%dchar%,10,1
return char
}
; Simple calculator
LoadToolComposeCalc() {
global
CDS__CompU000075U000063 := "P__Cal1" ; uc
CDS__CompU000075U000043 := "P__Cal2" ; uC
CDS__CompU000055U000063 := "P__Cal1" ; Uc
CDS__CompU000055U000043 := "P__Cal2" ; UC
}
GUISYM("P__Cal1","uc","t")
GUISYM("P__Cal2","UC","t")
CharProc__Cal1() {
global
; starte Calculator ohne Echo
PressHookProc := "Calc"
CalcEcho := 0
CalcVar1 := ""
CalcVar2 := ""
CalcOp := ""
CalcPhase := 0
CalcHexOut := 0
}
CharProc__Cal2() {
global
; starte Calculator mit Echo
PressHookProc := "Calc"
CalcEcho := 1
CalcVar1 := ""
CalcVar2 := ""
CalcOp := ""
CalcPhase := 0
CalcHexOut := 0
}
PressHookCalc(PhysKey, ActKey, Char) {
global
if (SubStr(Char,1,1) == "P")
CharStarDown(PhysKey, ActKey, Char)
else if (CalcPhase == 0) {
if ((Char == "U000030") or (Char == "S__N__0"))
CalcVar1 := CalcVar1 . "0"
else if ((Char == "U000031") or (Char == "S__N__1"))
CalcVar1 := CalcVar1 . "1"
else if ((Char == "U000032") or (Char == "S__N__2"))
CalcVar1 := CalcVar1 . "2"
else if ((Char == "U000033") or (Char == "S__N__3"))
CalcVar1 := CalcVar1 . "3"
else if ((Char == "U000034") or (Char == "S__N__4"))
CalcVar1 := CalcVar1 . "4"
else if ((Char == "U000035") or (Char == "S__N__5"))
CalcVar1 := CalcVar1 . "5"
else if ((Char == "U000036") or (Char == "S__N__6"))
CalcVar1 := CalcVar1 . "6"
else if ((Char == "U000037") or (Char == "S__N__7"))
CalcVar1 := CalcVar1 . "7"
else if ((Char == "U000038") or (Char == "S__N__8"))
CalcVar1 := CalcVar1 . "8"
else if ((Char == "U000039") or (Char == "S__N__9"))
CalcVar1 := CalcVar1 . "9"
else if ((Char == "U000039") or (Char == "S__N__9"))
CalcVar1 := CalcVar1 . "9"
else if ((Char == "U000041") or (Char == "U000061"))
CalcVar1 := CalcVar1 . "A"
else if ((Char == "U000042") or (Char == "U000062"))
CalcVar1 := CalcVar1 . "B"
else if ((Char == "U000043") or (Char == "U000063"))
CalcVar1 := CalcVar1 . "C"
else if ((Char == "U000044") or (Char == "U000064"))
CalcVar1 := CalcVar1 . "D"
else if ((Char == "U000045") or (Char == "U000065"))
CalcVar1 := CalcVar1 . "E"
else if ((Char == "U000046") or (Char == "U000066"))
CalcVar1 := CalcVar1 . "F"
else if ((Char == "U00002E") or (Char == "U00002C") or (Char=="S__NDot"))
CalcVar1 := CalcVar1 . "."
else if ((Char == "U000078") or (Char == "U000058")) {
CalcVar1 := CalcVar1 . "x"
CalcHexOut := 1
} else if ((Char == "U00002B") or (Char == "S__NAdd")) {
CalcOp := "+"
CalcPhase := 1
} else if ((Char == "U00002D") or (Char == "S__NSub")) {
CalcOp := "-"
CalcPhase := 1
} else if ((Char == "U00002A") or (Char == "S__NMul")) {
CalcOp := "*"
CalcPhase := 1
} else if ((Char == "U00002F") or (Char == "S__NDiv")) {
CalcOp := "/"
CalcPhase := 1
} else if (Char == "U000026") {
CalcOp := "&"
CalcPhase := 1
} else if (Char == "U00007C") {
CalcOp := "|"
CalcPhase := 1
} else
PressHookProc := ""
if (CalcEcho) {
PP%PhysKey% := Char
PR%PhysKey% := Char
CharOutDown(Char)
}
} else if (CalcPhase == 1) {
if ((Char == "U000030") or (Char == "S__N__0"))
CalcVar2 := CalcVar2 . "0"
else if ((Char == "U000031") or (Char == "S__N__1"))
CalcVar2 := CalcVar2 . "1"
else if ((Char == "U000032") or (Char == "S__N__2"))
CalcVar2 := CalcVar2 . "2"
else if ((Char == "U000033") or (Char == "S__N__3"))
CalcVar2 := CalcVar2 . "3"
else if ((Char == "U000034") or (Char == "S__N__4"))
CalcVar2 := CalcVar2 . "4"
else if ((Char == "U000035") or (Char == "S__N__5"))
CalcVar2 := CalcVar2 . "5"
else if ((Char == "U000036") or (Char == "S__N__6"))
CalcVar2 := CalcVar2 . "6"
else if ((Char == "U000037") or (Char == "S__N__7"))
CalcVar2 := CalcVar2 . "7"
else if ((Char == "U000038") or (Char == "S__N__8"))
CalcVar2 := CalcVar2 . "8"
else if ((Char == "U000039") or (Char == "S__N__9"))
CalcVar2 := CalcVar2 . "9"
else if ((Char == "U000041") or (Char == "U000061"))
CalcVar2 := CalcVar2 . "A"
else if ((Char == "U000042") or (Char == "U000062"))
CalcVar2 := CalcVar2 . "B"
else if ((Char == "U000043") or (Char == "U000063"))
CalcVar2 := CalcVar2 . "C"
else if ((Char == "U000044") or (Char == "U000064"))
CalcVar2 := CalcVar2 . "D"
else if ((Char == "U000045") or (Char == "U000065"))
CalcVar2 := CalcVar2 . "E"
else if ((Char == "U000046") or (Char == "U000066"))
CalcVar2 := CalcVar2 . "F"
else if ((Char == "U00002E") or (Char == "U00002C") or (Char=="S__NDot"))
CalcVar2 := CalcVar2 . "."
else if ((Char == "U000078") or (Char == "U000058")) {
CalcVar2 := CalcVar2 . "x"
CalcHexOut := 1
} else if ((Char == "U00000D") or (Char == "S__NEnt") or (Char=="U000020") or (Char=="U00003D")) {
if (CalcOp == "+")
CalcResult := CalcVar1 + CalcVar2
else if (CalcOp == "-")
CalcResult := CalcVar1 - CalcVar2
else if (CalcOp == "*")
CalcResult := CalcVar1 * CalcVar2
else if (CalcOp == "/")
CalcResult := CalcVar1 / CalcVar2
else if (CalcOp == "&")
CalcResult := CalcVar1 & CalcVar2
else if (CalcOp == "|")
CalcResult := CalcVar1 | CalcVar2
else
CalcResult := "Invalid"
if (CalcHexOut and (CalcResult != "")) {
SetFormat,Integer,h
CalcResult := CalcResult + 0
SetFormat,Integer,d
}
tosend := util_char2UCode(CalcResult)
if (CalcEcho) {
Char := "U00003D"
PP%PhysKey% := Char
PR%PhysKey% := Char
CharOutDown(Char)
}
loop {
if (SubStr(tosend,1,1)=="P") {
SubProc := SubStr(tosend,2,6)
CharProc%SubProc%()
} else {
CharOut(SubStr(tosend,1,7))
}
tosend := SubStr(tosend,8)
if (tosend == "")
break ; erledigt
}
PressHookProc := ""
return ; vermeide, bei CharEcho das aktuelle Zeichen nach dem Ergebnis noch einmal auszugeben
} else
PressHookProc := ""
if (CalcEcho) {
PP%PhysKey% := Char
PR%PhysKey% := Char
CharOutDown(Char)
}
} else {
PressHookProc := ""
if (CalcEcho) {
PP%PhysKey% := Char
PR%PhysKey% := Char
CharOutDown(Char)
}
}
}
; "Wie mit Neo?" assistant
LoadToolComposeWMN() {
global
CDS__CompU000075U000077 := "P___WMN" ; uw
CDS__CompU000075U000057 := "P___WMN" ; uW
CDS__CompU000055U000077 := "P___WMN" ; Uw
CDS__CompU000055U000057 := "P___WMN" ; UW
}
GUISYM("P___WMN","UW","t")
CharProc___WMN() {
global
ok := DllCall("User32.dll\OpenClipboard", "Ptr", 0)
if (!ok) {
TrayTip,Wie mit NEO,Fehler in OpenClipboard,10,1
return
}
uclph:=DllCall("GetClipboardData","uint",CF_UNICODETEXT:=13)
if (uclph == 0) {
DllCall("CloseClipboard")
TrayTip,Wie mit NEO,Fehler in GetClipboardData,10,1
return
}
uclp := DllCall("GlobalLock","uint",uclph)
if (uclp == 0) {
DllCall("CloseClipboard")
TrayTip,Wie mit NEO,Fehler in GlobalLock,10,1
return
}
a := *(uclp+0)
b := *(uclp+1)
a += 256*b
if ((a >= 0xD800) and (a <= 0xDBFF)) {
c := *(uclp+2)
d := *(uclp+3)
c += 256*d
if ((c >= 0xDC00) and (c <= 0xDFFF)) {
a := (a & 0x3FF) * 1024 + (c & 0x3FF) + 65536
}
}
DllCall("GlobalUnlock","uint",uclph)
DllCall("CloseClipboard")
SetFormat,Integer,h
a += 0
SetFormat,Integer,d
if (a < 0x10000) {
ap := "U" . substr("000000" . substr(a,3),-3)
a := "U" . substr("000000" . substr(a,3),-5)
} else {
ap := "U" . substr("000000" . substr(a,3),-5)
a := ap
}
Gui, New, +AlwaysOnTop +HwndWMNGuiHwnd +LabelWMNOn
Gui, %WMNGuiHwnd%:Font,norm
Gui, %WMNGuiHwnd%:Margin,10,0
Gui, %WMNGuiHwnd%:Add,Text,,% "`r`nDas Zeichen " . ap . " kann wie folgt eingegeben werden:"
loop,parse,CRC%a%,%A_Space%
{
this_wmn := ""
this_wmnk := ""
nthis := 0
this_wtt := A_LoopField
if (this_wtt == "")
continue ; probably at first or last entry
loop {
if (this_wtt == "")
break
this_char7 := substr(this_wtt,1,7)
this_char := this_char7
this_wtt := substr(this_wtt,8)
if (CB%this_char% != "")
this_char := CB%this_char%
else if (CS%this_char% != "")
this_char := CS%this_char%
; this_char will contain Uxxxx if no shortcut is present. Fix this here.
this_wmn .= " <" . this_char . ">"
if (CRK%this_char7% == "") {
nthis := 1
this_wmnk .= " <" . this_char7 . ">"
} else
this_wmnk .= " " . KeyLong(CRK%this_char7%)
}
if (this_wmn != "")
this_wmn := SubStr(this_wmn,2)
if (this_wmnk != "")
this_wmnk := SubStr(this_wmnk,2)
Gui, %WMNGuiHwnd%:Font,bold
if (nthis == 1)
Gui, %WMNGuiHwnd%:Add,Text,,% "Wegen fehlender Tastenbelegung nicht als Compose:"
else
Gui, %WMNGuiHwnd%:Add,Text,,% "Als Compose:"
Gui, %WMNGuiHwnd%:Font,norm
Gui, %WMNGuiHwnd%:Add,Text,,% this_wmn . "`r`noder`r`n" . this_wmnk
}
wmnk := KeyLong(CRK%a%)
Gui, %WMNGuiHwnd%:Font,bold
if (wmnk != "") {
Gui, %WMNGuiHwnd%:Add,Text,,% "Als Tastendruck:"
Gui, %WMNGuiHwnd%:Font,norm
Gui, %WMNGuiHwnd%:Add,Text,,% wmnk
} else
Gui, %WMNGuiHwnd%:Add,Text,,% "Als Tastendruck nicht verfuegbar"
btnEventFun := Func("WMNOnClose").Bind(WMNGuiHwnd) ; button closes assocaited GUI
Gui, %WMNGuiHwnd%:Add, Button, Default xp+100 yp+40 vWMNButton, OK
GuiControl +g, WMNButton, %btnEventFun%
Gui, %WMNGuiHwnd%:Show
}
WMNOnEscape(hwnd) {
WMNOnClose(hwnd)
}
WMNOnClose(hwnd) {
Gui, %hwnd%:Destroy
}
KeyLong(key) {
global
num := 0
twmnk := ""
loop,parse,key,%A_Space%
{
tis_wmn := ""
tis_wtt := A_LoopField
if (tis_wtt == "")
continue ; probably at first or last entry
tis_layer := substr(tis_wtt,3,1)
base_key_pos := "CP1" . substr(tis_wtt,4)
base_key := %base_key_pos%
if (CB%base_key_pos% != "")
base_key := CB%base_key_pos%
else if (CB%base_key% != "")
base_key := CB%base_key%
else if (CS%base_key% != "")
base_key := CS%base_key%
twmnk .= "/<" . CBS____M%tis_layer% . base_key . ">"
num := num + 1
}
if (num == 0)
return ""
else if (num == 1)
return SubStr(twmnk,2)
else
return "(" . SubStr(twmnk,2) . ")"
}
; Tools global
; Load compose definitions used by tools
; Overwrites existing compose definitions!
; (compositions with similar or shared initial sequence may become unreachable)
LoadToolCompose() {
global
LoadToolComposeRoman()
LoadToolComposeUni()
LoadToolComposeCalc()
LoadToolComposeWMN()
}