summaryrefslogtreecommitdiffstats
path: root/windows/neo-vars/src/source/tools.ahk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--windows/neo-vars/src/source/tools.ahk284
1 files changed, 284 insertions, 0 deletions
diff --git a/windows/neo-vars/src/source/tools.ahk b/windows/neo-vars/src/source/tools.ahk
new file mode 100644
index 0000000..d248cf4
--- /dev/null
+++ b/windows/neo-vars/src/source/tools.ahk
@@ -0,0 +1,284 @@
+; äöü
+
+; Römische Zahlen
+
+CMSCompU0072 := 1
+CMSCompU0052 := 1
+CDSCompU0072U0072 := "PRom1"
+CDSCompU0072U0031 := "PRom1"
+CDSCompU0052U0031 := "PRom1"
+CDSCompU0072U0052 := "PRom2"
+CDSCompU0072U0032 := "PRom2"
+CDSCompU0052U0032 := "PRom2"
+CDSCompU0052U0072 := "PRom3"
+CDSCompU0072U0033 := "PRom3"
+CDSCompU0052U0033 := "PRom3"
+CDSCompU0052U0052 := "PRom4"
+CDSCompU0072U0034 := "PRom4"
+CDSCompU0052U0034 := "PRom4"
+
+CharProcRom1() {
+ global
+ ; starte groß geschriebene römische Zahlen, verwende U2160++
+ PressHookProc := "Roman"
+ RomanMode := 1
+ RomanSum := 0
+}
+
+CharProcRom2() {
+ global
+ ; starte klein geschriebene römische Zahlen, verwende U2160++
+ PressHookProc := "Roman"
+ RomanMode := 2
+ RomanSum := 0
+}
+
+CharProcRom3() {
+ global
+ ; starte groß geschriebene römische Zahlen, verwende Buchstaben
+ PressHookProc := "Roman"
+ RomanMode := 3
+ RomanSum := 0
+}
+
+CharProcRom4() {
+ global
+ ; starte klein 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 := str%Pos%
+ return res
+}
+
+PressHookRoman(PhysKey, ActKey, Char) {
+ global
+ if ((Char == "U0030") or (Char == "SN__0"))
+ RomanSum := 10*RomanSum
+ else if ((Char == "U0031") or (Char == "SN__1"))
+ RomanSum := 10*RomanSum + 1
+ else if ((Char == "U0032") or (Char == "SN__2"))
+ RomanSum := 10*RomanSum + 2
+ else if ((Char == "U0033") or (Char == "SN__3"))
+ RomanSum := 10*RomanSum + 3
+ else if ((Char == "U0034") or (Char == "SN__4"))
+ RomanSum := 10*RomanSum + 4
+ else if ((Char == "U0035") or (Char == "SN__5"))
+ RomanSum := 10*RomanSum + 5
+ else if ((Char == "U0036") or (Char == "SN__6"))
+ RomanSum := 10*RomanSum + 6
+ else if ((Char == "U0037") or (Char == "SN__7"))
+ RomanSum := 10*RomanSum + 7
+ else if ((Char == "U0038") or (Char == "SN__8"))
+ RomanSum := 10*RomanSum + 8
+ else if ((Char == "U0039") or (Char == "SN__9"))
+ RomanSum := 10*RomanSum + 9
+ else if ((Char == "U000D") or (Char == "U0020")) {
+ RomanSum := mod(RomanSum,400000)
+ RomanStr := ""
+ RomanPos := 0
+ if (RomanMode == 1)
+ loop {
+ RomanDigit := mod(RomanSum,10)
+ RomanSum := RomanSum//10
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"U2170","U2179","U217D","U217F","U2182","U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U2170U2170","U2179U2179","U217DU217D","U217FU217F","U2182U2182","U2188U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U2170U2170U2170","U2179U2179U2179","U217DU217DU217D","U217FU217FU217F","U2182U2182U2182","U2188U2188U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U2170U2174","U2179U217C","U217DU217E","U2180U2181","U2182U2187","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U2174","U217C","U217E","U2181","U2187","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U2174U2170","U217CU2179","U217EU217D","U2181U2180","U2187U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U2174U2170U2170","U217CU2179U2179","U217EU217DU217D","U2181U2180U2180","U2187U2182U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U2174U2170U2170U2170","U217CU2179U2179U2179","U217EU217DU217DU217D","U2181U2180U2180U2180","U2187U2182U2182U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U2178","U2179U217D","U217DU217F","U2180U2182","U2182U2188","") . 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,"U2160","U2169","U216D","U216F","U2182","U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U2160U2160","U2169U2169","U216DU216D","U216FU216F","U2182U2182","U2188U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U2160U2160U2160","U2169U2169U2169","U216DU216DU216D","U216FU216FU216F","U2182U2182U2182","U2188U2188U2188") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U2160U2164","U2169U216C","U216DU216E","U2180U2181","U2182U2187","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U2164","U216C","U216E","U2181","U2187","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U2164U2160","U216CU2169","U216EU216D","U2181U2180","U2187U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U2164U2160U2160","U216CU2169U2169","U216EU216DU216D","U2181U2180U2180","U2187U2182U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U2164U2160U2160U2160","U216CU2169U2169U2169","U216EU216DU216DU216D","U2181U2180U2180U2180","U2187U2182U2182U2182","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U2160U2169","U2169U216D","U216DU216F","U2180U2182","U2182U2188","") . 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,"U0069","U0078","U0063","U006D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U0069U0069","U0078U0078","U0063U0063","U006DU006D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U0069U0069U0069","U0078U0078U0078","U0063U0063U0063","U006DU006DU006D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U0069U0076","U0078U006C","U0063U0064","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U0076","U006C","U0064","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U0076U0069","U006CU0078","U0064U0063","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U0076U0069U0069","U006CU0078U0078","U0064U0063U0063","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U0076U0069U0069U0069","U006CU0078U0078U0078","U0064U0063U0063U0063","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U0069U0078","U0078U0063","U0063U006D","","","") . 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,"U0049","U0058","U0043","U004D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U0049U0049","U0058U0058","U0043U0043","U004DU004D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U0049U0049U0049","U0058U0058U0058","U0043U0043U0043","U004DU004DU004D","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U0049U0056","U0058U004C","U0043U0044","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U0056","U004C","U0044","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U0056U0049","U004CU0058","U0044U0043","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U0056U0049U0049","U004CU0058U0058","U0044U0043U0043","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U0056U0049U0049U0049","U004CU0058U0058U0058","U0044U0043U0043U0043","","","") . RomanStr
+ RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U0049U0058","U0058U0043","U0043U004D","","","") . RomanStr
+ if (RomanSum == 0)
+ break
+ RomanPos := RomanPos + 1
+ }
+ loop {
+ if (RomanStr == "")
+ break ; erledigt
+ CharOut(SubStr(RomanStr,1,5))
+ RomanStr := SubStr(RomanStr,6)
+ }
+ PressHookProc := ""
+ } else
+ PressHookProc := ""
+}
+
+CMSCompU0075 := 1
+CMSCompU0055 := 1
+CDSCompU0075U0075 := "P_Uni"
+CDSCompU0075U0055 := "P_Uni"
+CDSCompU0055U0075 := "P_Uni"
+CDSCompU0055U0055 := "P_Uni"
+CMSCompU0064 := 1
+CMSCompU0044 := 1
+CDSCompU0064U0064 := "PDUni"
+CDSCompU0064U0044 := "PDUni"
+CDSCompU0044U0064 := "PDUni"
+CDSCompU0044U0044 := "PDUni"
+
+CP5VK41SC01E := "P_Uni"
+
+CharProc_Uni() {
+ global
+ ; starte Unicode-Hex-in-Zeichen-Umwandlung
+ PressHookProc := "Uni"
+ UniSum := ""
+}
+
+CharProcDUni() {
+ global
+ ; starte Unicode-Zeichen-in-Hex-Umwandlung
+ CharOutFilterProc := "DUni"
+}
+
+PressHookUni(PhysKey, ActKey, Char) {
+ global
+ if ((Char == "U0030") or (Char == "SN__0"))
+ UniSum := UniSum . "0"
+ else if ((Char == "U0031") or (Char == "SN__1"))
+ UniSum := UniSum . "1"
+ else if ((Char == "U0032") or (Char == "SN__2"))
+ UniSum := UniSum . "2"
+ else if ((Char == "U0033") or (Char == "SN__3"))
+ UniSum := UniSum . "3"
+ else if ((Char == "U0034") or (Char == "SN__4"))
+ UniSum := UniSum . "4"
+ else if ((Char == "U0035") or (Char == "SN__5"))
+ UniSum := UniSum . "5"
+ else if ((Char == "U0036") or (Char == "SN__6"))
+ UniSum := UniSum . "6"
+ else if ((Char == "U0037") or (Char == "SN__7"))
+ UniSum := UniSum . "7"
+ else if ((Char == "U0038") or (Char == "SN__8"))
+ UniSum := UniSum . "8"
+ else if ((Char == "U0039") or (Char == "SN__9"))
+ UniSum := UniSum . "9"
+ else if ((Char == "U0041") or (Char == "U0061"))
+ UniSum := UniSum . "A"
+ else if ((Char == "U0042") or (Char == "U0062"))
+ UniSum := UniSum . "B"
+ else if ((Char == "U0043") or (Char == "U0063"))
+ UniSum := UniSum . "C"
+ else if ((Char == "U0044") or (Char == "U0064"))
+ UniSum := UniSum . "D"
+ else if ((Char == "U0045") or (Char == "U0065"))
+ UniSum := UniSum . "E"
+ else if ((Char == "U0046") or (Char == "U0066"))
+ UniSum := UniSum . "F"
+ else if ((Char == "U000D") or (Char == "U0020")) {
+ UniSum := "U" . SubStr("0000" . UniSum, -3)
+ PP%PhysKey% := UniSum
+ PR%PhysKey% := UniSum
+ CharOutDown(UniSum)
+ PressHookProc := ""
+ } else
+ PressHookProc := ""
+}
+
+CharOutFilterDUni(char,down,up) {
+ global
+ if (!down)
+ return char
+ CharOutFilterProc := ""
+ TrayTip,Unicode-Zeichen,%char%,10,1
+ return char
+}
+
+EncodeUni(str) {
+SetFormat, Integer, hex
+; MsgBox % Asc(SubStr(str,1,1)) . Asc(SubStr(str,2,1))
+ result := ""
+ loop {
+ char := SubStr(str,1,1)
+ str := SubStr(str,2)
+ if (asc(char) < 0x80)
+ result := result . "U00" . SubStr(asc(char),3)
+ else if (asc(char) < 0xC0) {
+ ; error
+ } else if (asc(char) < 0xE0) {
+ char2 := Substr(str,1,1)
+ str := SubStr(str,2)
+ if ((asc(char2) < 0x80) or (asc(char2) > 0xBF)) {
+ ; error
+ } else {
+ result := result . "U" . SubStr("0000" . SubStr((((asc(char) & 0x1F) << 6) + (asc(char2) & 0x3F)),3),-3)
+ }
+ } else if (asc(char) < 0xF8) {
+ char2 := SubStr(str,1,1)
+ char3 := SubStr(str,2,1)
+ str := SubStr(str,3)
+; MsgBox % "chars: " . char . ", " . char2 . ", " . char3 . ", str: " . str
+ if ((asc(char2) < 0x80) or (asc(char2) > 0xBF)
+ or (asc(char3) < 0x80) or (asc(char3) > 0xBF)) {
+ ; error
+ } else {
+; MsgBox % asc(char) . asc(char2) . asc(char3)
+; MsgBox % (((asc(char) & 0x0F) << 12) + ((asc(char2) & 0x3F) << 6) + (asc(char3) & 0x3F))
+ result := result . "U" . SubStr("0000" . SubStr((((asc(char) & 0x0F) << 12) + ((asc(char2) & 0x3F) << 6) + (asc(char3) & 0x3F)),3),-3)
+ }
+ }
+ if (str == "")
+ break
+ }
+ SetFormat, Integer, d
+ StringUpper,result,result
+ return result
+}