| 1 | #MaxThreadsPerHotKey 4 |
|---|
| 2 | |
|---|
| 3 | ; die Compose-Definitionen |
|---|
| 4 | #Include %a_scriptdir%\en_us.ahk |
|---|
| 5 | #Include %a_scriptdir%\neocomp.ahk |
|---|
| 6 | #Include %a_scriptdir%\neovarscomp.ahk |
|---|
| 7 | |
|---|
| 8 | Comp := "" |
|---|
| 9 | |
|---|
| 10 | ; Hier liegt die Tastaturbelegung |
|---|
| 11 | #Include %a_scriptdir%\keydefinitions.ahk |
|---|
| 12 | |
|---|
| 13 | ; Shortcuts, um die Zeichen wieder sauber zur Applikation bringen zu k�nnen |
|---|
| 14 | #Include %a_scriptdir%\shortcuts.ahk |
|---|
| 15 | |
|---|
| 16 | ; Good-old AHK-Skripts, enthalten die ersten Key-Hooks f�r Mod-Tasten |
|---|
| 17 | ; Achtung: Hinter dem ersten Keyboard-Hook werden keine globalen Variablen |
|---|
| 18 | ; mehr gesetzt! |
|---|
| 19 | #Include %a_scriptdir%\recycle.ahk |
|---|
| 20 | |
|---|
| 21 | ; Normale Keyboard-Hooks |
|---|
| 22 | #Include %a_scriptdir%\keyhooks.ahk |
|---|
| 23 | |
|---|
| 24 | AllStar(This_HotKey) { |
|---|
| 25 | global |
|---|
| 26 | PhysKey := This_HotKey |
|---|
| 27 | EbeneAktualisieren() |
|---|
| 28 | if (SubStr(PhysKey,1,1) == "*") |
|---|
| 29 | PhysKey := SubStr(PhysKey,2) |
|---|
| 30 | if (SubStr(PhysKey,-2) == " up") { |
|---|
| 31 | PhysKey := SubStr(PhysKey,1,StrLen(PhysKey)-3) |
|---|
| 32 | IsDown := 0 |
|---|
| 33 | } else |
|---|
| 34 | IsDown := 1 |
|---|
| 35 | ActKey := PhysKey ; das k�nnte sp�ter f�r eine Transformation benutzt werden |
|---|
| 36 | if ((striktesMod2Lock == 0) && (NOC%ActKey% == 1)) |
|---|
| 37 | Ebene := EbeneNC |
|---|
| 38 | if (Ebene7 and (CP7%ActKey% != "")) |
|---|
| 39 | Char := CP7%ActKey% |
|---|
| 40 | else if (Ebene8 and (CP8%ActKey% != "")) |
|---|
| 41 | Char := CP8%ActKey% |
|---|
| 42 | else |
|---|
| 43 | Char := CP%Ebene%%ActKey% |
|---|
| 44 | if (IsPressHooked == 1) { |
|---|
| 45 | if (IsDown == 1) |
|---|
| 46 | PressHookProc(PressHookRoutine, PhysKey, ActKey, Char) |
|---|
| 47 | } else if (IsDown == 1) |
|---|
| 48 | CharStarDown(PhysKey, ActKey, Char) |
|---|
| 49 | else |
|---|
| 50 | CharStarUp(PhysKey) |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | CharStarDown(PhysKey, ActKey, char) { |
|---|
| 54 | global |
|---|
| 55 | CompEntry := Comp |
|---|
| 56 | if (PP%PhysKey% != "") |
|---|
| 57 | Comp := PP%PhysKey% ; resulting from key repeat |
|---|
| 58 | else |
|---|
| 59 | Comp := Comp . char ; normal compositum |
|---|
| 60 | |
|---|
| 61 | tosend := "" |
|---|
| 62 | PP%PhysKey% := "" |
|---|
| 63 | |
|---|
| 64 | if (CD%Comp% != "") { |
|---|
| 65 | tosend := CD%Comp% |
|---|
| 66 | PP%PhysKey% := Comp |
|---|
| 67 | Comp := "" |
|---|
| 68 | } else if (CM%Comp% != 1) { |
|---|
| 69 | Comp := "" |
|---|
| 70 | if (CompEntry == "") { |
|---|
| 71 | tosend := char |
|---|
| 72 | PP%PhysKey% := char |
|---|
| 73 | } |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | if (strlen(tosend) > 5) { ; multiple chars |
|---|
| 77 | if (PR%PhysKey% != "") |
|---|
| 78 | CharOutUp(PR%PhysKey%) |
|---|
| 79 | PR%PhysKey% := "" |
|---|
| 80 | |
|---|
| 81 | loop { |
|---|
| 82 | if (tosend == "") |
|---|
| 83 | break ; erledigt |
|---|
| 84 | if (SubStr(tosend,1,1)=="P") { |
|---|
| 85 | CharProc(SubStr(tosend,2,4)) |
|---|
| 86 | } else { |
|---|
| 87 | CharOut(SubStr(tosend,1,5)) |
|---|
| 88 | } |
|---|
| 89 | tosend := SubStr(tosend,6) |
|---|
| 90 | } |
|---|
| 91 | } else if (tosend != "") |
|---|
| 92 | if (SubStr(tosend,1,1)=="P") { |
|---|
| 93 | if (PR%PhysKey% != "") |
|---|
| 94 | CharOutUp(PR%PhysKey%) |
|---|
| 95 | PR%PhysKey% := "" |
|---|
| 96 | CharProc(SubStr(tosend,2)) |
|---|
| 97 | } else { |
|---|
| 98 | if ((PR%PhysKey% != "") and (PR%PhysKey% != tosend)) |
|---|
| 99 | CharOutUp(PR%PhysKey%) |
|---|
| 100 | PR%PhysKey% := tosend |
|---|
| 101 | CharOutDown(tosend) |
|---|
| 102 | } |
|---|
| 103 | else { |
|---|
| 104 | if (PR%PhysKey% != "") |
|---|
| 105 | CharOutUp(PR%PhysKey%) |
|---|
| 106 | PR%PhysKey% := "" |
|---|
| 107 | } |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | CharStarUp(PhysKey) { |
|---|
| 111 | global |
|---|
| 112 | if (PR%PhysKey% != "") |
|---|
| 113 | CharOutUp(PR%PhysKey%) ; resulting from key repeat |
|---|
| 114 | |
|---|
| 115 | PR%PhysKey% := "" |
|---|
| 116 | PP%PhysKey% := "" |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | CharOut(char) { |
|---|
| 121 | global |
|---|
| 122 | if (DNCS%char% != "") { |
|---|
| 123 | seq := DNCS%char% . UPCS%char% |
|---|
| 124 | if (isShiftPressed and UNSH%char%) |
|---|
| 125 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 126 | send % "{blind}" . seq |
|---|
| 127 | } else if (CS%char% != "") { |
|---|
| 128 | seq := "{" . CS%char% . "}" |
|---|
| 129 | if (isShiftPressed and UNSH%char%) |
|---|
| 130 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 131 | send % "{blind}" . seq |
|---|
| 132 | } else |
|---|
| 133 | SendUnicodeChar("0x" . SubStr(char,2)) |
|---|
| 134 | } |
|---|
| 135 | |
|---|
| 136 | CharOutDown(char) { |
|---|
| 137 | global |
|---|
| 138 | if (DNCS%char% != "") { |
|---|
| 139 | seq := DNCS%char% |
|---|
| 140 | if (isShiftPressed and UNSH%char%) |
|---|
| 141 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 142 | send % "{blind}" . seq |
|---|
| 143 | } else if (CS%char% != "") { |
|---|
| 144 | seq := CS%char% |
|---|
| 145 | seq := "{". seq . " down}" |
|---|
| 146 | if (isShiftPressed and UNSH%char%) |
|---|
| 147 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 148 | send % "{blind}" . seq |
|---|
| 149 | } else |
|---|
| 150 | SendUnicodeCharDown("0x" . SubStr(char,2)) |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | CharOutUp(char) { |
|---|
| 154 | global |
|---|
| 155 | if (DNCS%char% != "") { |
|---|
| 156 | seq := UPCS%char% |
|---|
| 157 | if (isShiftPressed and UNSH%char%) |
|---|
| 158 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 159 | send % "{blind}" . seq |
|---|
| 160 | } else if (CS%char% != "") { |
|---|
| 161 | seq := CS%char% |
|---|
| 162 | seq := "{". seq . " up}" |
|---|
| 163 | if (isShiftPressed and UNSH%char%) |
|---|
| 164 | seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) |
|---|
| 165 | send % "{blind}" . seq |
|---|
| 166 | } else |
|---|
| 167 | SendUnicodeCharUp("0x" . SubStr(char,2)) |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | FixSeq(seq,LP,RP) { |
|---|
| 171 | ret := seq |
|---|
| 172 | if (LP) |
|---|
| 173 | ret := "{Shift Up}" . ret . "{Shift Down}" |
|---|
| 174 | if (RP) |
|---|
| 175 | ret := "{RShift Up}" . ret . "{RShift Down}" |
|---|
| 176 | return ret |
|---|
| 177 | } |
|---|
| 178 | |
|---|
| 179 | CharProc(subroutine) { |
|---|
| 180 | global |
|---|
| 181 | if (subroutine == "_Rom") { |
|---|
| 182 | IsPressHooked := 1 |
|---|
| 183 | PressHookRoutine := "Roman" |
|---|
| 184 | RomanSum := 0 |
|---|
| 185 | } else if (subroutine == "_rom") { |
|---|
| 186 | IsPressHooked := 1 |
|---|
| 187 | PressHookRoutine := "roman" |
|---|
| 188 | RomanSum := 0 |
|---|
| 189 | } else if (subroutine == "_Uni") { |
|---|
| 190 | IsPressHooked := 1 |
|---|
| 191 | PressHookRoutine := "Uni" |
|---|
| 192 | UniSum := "" |
|---|
| 193 | } else if (subroutine == "DUni") { |
|---|
| 194 | IsPressHooked := 1 |
|---|
| 195 | PressHookRoutine := "DUni" |
|---|
| 196 | } else if (subroutine == "Rlod") |
|---|
| 197 | reload |
|---|
| 198 | else if (subroutine == "LnSt") { |
|---|
| 199 | ;Lang-s-Tastatur: |
|---|
| 200 | LangSTastatur := !(LangSTastatur) |
|---|
| 201 | if (LangSTastatur) |
|---|
| 202 | CharProc("LnS1") |
|---|
| 203 | else |
|---|
| 204 | CharProc("LnS0") |
|---|
| 205 | } else if (subroutine == "LnS1") { |
|---|
| 206 | ED("VKBASC01A",1,"U0073","U1E9E","U00DF","" ,"U03C2","U2218") ; � |
|---|
| 207 | ED("VK48SC023",1,"U017F","U0053","U003F","U00BF","U03C3","U03A3","U0073") ; s |
|---|
| 208 | KeyboardLED(2,"on") |
|---|
| 209 | } else if (subroutine == "LnS0") { |
|---|
| 210 | ED("VKBASC01A",1,"U00DF","U1E9E","U017F","" ,"U03C2","U2218") ; � |
|---|
| 211 | ED("VK48SC023",1,"U0073","U0053","U003F","U00BF","U03C3","U03A3","U017F") ; s |
|---|
| 212 | KeyboardLED(2,"off") |
|---|
| 213 | } else if (subroutine == "_VMt") { |
|---|
| 214 | ; Belegungsvariante VM |
|---|
| 215 | isVM := !(isVM) |
|---|
| 216 | if (isVM) |
|---|
| 217 | CharProc("_VM1") |
|---|
| 218 | else |
|---|
| 219 | CharProc("_VM0") |
|---|
| 220 | } else if (subroutine == "_VM1") { |
|---|
| 221 | ED("VK51SC010",1,"U0079","U0059","U2026","U22EE","U03C5","U2207") ; y |
|---|
| 222 | ED("VK57SC011",1,"U006F","U004F","U005F","U0008","U03BF","U2208") ; o |
|---|
| 223 | ED("VK45SC012",1,"U0061","U0041","U005B","S__Up","U03B1","U2200") ; a |
|---|
| 224 | ED("VK52SC013",1,"U0070","U0050","U005D","S_Del","U03C0","U03A0") ; p |
|---|
| 225 | ED("VK41SC01E",1,"U0069","U0049","U005C","SHome","U03B9","U222B") ; i |
|---|
| 226 | ED("VK53SC01F",1,"U0075","U0055","U002F","SLeft","P_Uni","U222E") ; u |
|---|
| 227 | ED("VK44SC020",1,"U0065","U0045","U007B","SDown","U03B5","U2203") ; e |
|---|
| 228 | ED("VK46SC021",1,"U0063","U0043","U007D","SRght","U03C7","U2102") ; c |
|---|
| 229 | ED("VK47SC022",1,"U006C","U004C","U002A","S_End","U03BB","U039B") ; l |
|---|
| 230 | ED("VKDESC028",1,"U0078","U0058","U0040","U002E","U03BE","U039E") ; x |
|---|
| 231 | ED("VK56SC02F",1,"U0076","U0056","U007E","U000D","" ,"U2259") ; v |
|---|
| 232 | } else if (subroutine == "_VM0") { |
|---|
| 233 | ED("VK51SC010",1,"U0078","U0058","U2026","U22EE","U03BE","U039E") ; x |
|---|
| 234 | ED("VK57SC011",1,"U0076","U0056","U005F","U0008","" ,"U2259") ; v |
|---|
| 235 | ED("VK45SC012",1,"U006C","U004C","U005B","S__Up","U03BB","U039B") ; l |
|---|
| 236 | ED("VK52SC013",1,"U0063","U0043","U005D","S_Del","U03C7","U2102") ; c |
|---|
| 237 | ED("VK41SC01E",1,"U0075","U0055","U005C","SHome","P_Uni","U222E") ; u |
|---|
| 238 | ED("VK53SC01F",1,"U0069","U0049","U002F","SLeft","U03B9","U222B") ; i |
|---|
| 239 | ED("VK44SC020",1,"U0061","U0041","U007B","SDown","U03B1","U2200") ; a |
|---|
| 240 | ED("VK46SC021",1,"U0065","U0045","U007D","SRght","U03B5","U2203") ; e |
|---|
| 241 | ED("VK47SC022",1,"U006F","U004F","U002A","S_End","U03BF","U2208") ; o |
|---|
| 242 | ED("VKDESC028",1,"U0079","U0059","U0040","U002E","U03C5","U2207") ; y |
|---|
| 243 | ED("VK56SC02F",1,"U0070","U0050","U007E","U000D","U03C0","U03A0") ; p |
|---|
| 244 | } |
|---|
| 245 | } |
|---|
| 246 | |
|---|
| 247 | PressHookProc(HookRoutine, PhysKey, ActKey, Char) { |
|---|
| 248 | global |
|---|
| 249 | if ((HookRoutine == "Roman") or (HookRoutine == "roman")) { |
|---|
| 250 | if ((Char == "U0030") or (Char == "SN__0")) |
|---|
| 251 | RomanSum := 10*RomanSum |
|---|
| 252 | else if ((Char == "U0031") or (Char == "SN__1")) |
|---|
| 253 | RomanSum := 10*RomanSum + 1 |
|---|
| 254 | else if ((Char == "U0032") or (Char == "SN__2")) |
|---|
| 255 | RomanSum := 10*RomanSum + 2 |
|---|
| 256 | else if ((Char == "U0033") or (Char == "SN__3")) |
|---|
| 257 | RomanSum := 10*RomanSum + 3 |
|---|
| 258 | else if ((Char == "U0034") or (Char == "SN__4")) |
|---|
| 259 | RomanSum := 10*RomanSum + 4 |
|---|
| 260 | else if ((Char == "U0035") or (Char == "SN__5")) |
|---|
| 261 | RomanSum := 10*RomanSum + 5 |
|---|
| 262 | else if ((Char == "U0036") or (Char == "SN__6")) |
|---|
| 263 | RomanSum := 10*RomanSum + 6 |
|---|
| 264 | else if ((Char == "U0037") or (Char == "SN__7")) |
|---|
| 265 | RomanSum := 10*RomanSum + 7 |
|---|
| 266 | else if ((Char == "U0038") or (Char == "SN__8")) |
|---|
| 267 | RomanSum := 10*RomanSum + 8 |
|---|
| 268 | else if ((Char == "U0039") or (Char == "SN__9")) |
|---|
| 269 | RomanSum := 10*RomanSum + 9 |
|---|
| 270 | else if ((Char == "U000D") or (Char == "U0020")) { |
|---|
| 271 | RomanSum := mod(RomanSum,400000) |
|---|
| 272 | RomanStr := "" |
|---|
| 273 | RomanPos := 0 |
|---|
| 274 | if (HookRoutine == "Roman") |
|---|
| 275 | loop { |
|---|
| 276 | RomanDigit := mod(RomanSum,10) |
|---|
| 277 | RomanSum := RomanSum//10 |
|---|
| 278 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"U2160","U2169","U216D","U216F","U2182","U2188") . RomanStr |
|---|
| 279 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U2160U2160","U2169U2169","U216DU216D","U216FU216F","U2182U2182","U2188U2188") . RomanStr |
|---|
| 280 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U2160U2160U2160","U2169U2169U2169","U216DU216DU216D","U216FU216FU216F","U2182U2182U2182","U2188U2188U2188") . RomanStr |
|---|
| 281 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U2160U2164","U2169U216C","U216DU216E","U2180U2181","U2182U2187","") . RomanStr |
|---|
| 282 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U2164","U216C","U216E","U2181","U2187","") . RomanStr |
|---|
| 283 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U2164U2160","U216CU2169","U216EU216D","U2181U2180","U2187U2182","") . RomanStr |
|---|
| 284 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U2164U2160U2160","U216CU2169U2169","U216EU216DU216D","U2181U2180U2180","U2187U2182U2182","") . RomanStr |
|---|
| 285 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U2164U2160U2160U2160","U216CU2169U2169U2169","U216EU216DU216DU216D","U2181U2180U2180U2180","U2187U2182U2182U2182","") . RomanStr |
|---|
| 286 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U2160U2169","U2169U216D","U216DU216F","U2180U2182","U2182U2188","") . RomanStr |
|---|
| 287 | if (RomanSum == 0) |
|---|
| 288 | break |
|---|
| 289 | RomanPos := RomanPos + 1 |
|---|
| 290 | } |
|---|
| 291 | else |
|---|
| 292 | loop { |
|---|
| 293 | RomanDigit := mod(RomanSum,10) |
|---|
| 294 | RomanSum := RomanSum//10 |
|---|
| 295 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,1,"U2170","U2179","U217D","U217F","U2182","U2188") . RomanStr |
|---|
| 296 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,2,"U2170U2170","U2179U2179","U217DU217D","U217FU217F","U2182U2182","U2188U2188") . RomanStr |
|---|
| 297 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,3,"U2170U2170U2170","U2179U2179U2179","U217DU217DU217D","U217FU217FU217F","U2182U2182U2182","U2188U2188U2188") . RomanStr |
|---|
| 298 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,4,"U2170U2174","U2179U217C","U217DU217E","U2180U2181","U2182U2187","") . RomanStr |
|---|
| 299 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,5,"U2174","U217C","U217E","U2181","U2187","") . RomanStr |
|---|
| 300 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,6,"U2174U2170","U217CU2179","U217EU217D","U2181U2180","U2187U2182","") . RomanStr |
|---|
| 301 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,7,"U2174U2170U2170","U217CU2179U2179","U217EU217DU217D","U2181U2180U2180","U2187U2182U2182","") . RomanStr |
|---|
| 302 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,8,"U2174U2170U2170U2170","U217CU2179U2179U2179","U217EU217DU217DU217D","U2181U2180U2180U2180","U2187U2182U2182U2182","") . RomanStr |
|---|
| 303 | RomanStr := GenRomanDigit(RomanPos,RomanDigit,9,"U2178","U2179U217D","U217DU217F","U2180U2182","U2182U2188","") . RomanStr |
|---|
| 304 | if (RomanSum == 0) |
|---|
| 305 | break |
|---|
| 306 | RomanPos := RomanPos + 1 |
|---|
| 307 | } |
|---|
| 308 | loop { |
|---|
| 309 | if (RomanStr == "") |
|---|
| 310 | break ; erledigt |
|---|
| 311 | CharOut(SubStr(RomanStr,1,5)) |
|---|
| 312 | RomanStr := SubStr(RomanStr,6) |
|---|
| 313 | } |
|---|
| 314 | IsPressHooked := 0 |
|---|
| 315 | } else |
|---|
| 316 | IsPressHooked := 0 |
|---|
| 317 | } else if (HookRoutine == "Uni") { |
|---|
| 318 | if ((Char == "U0030") or (Char == "SN__0")) |
|---|
| 319 | UniSum := UniSum . "0" |
|---|
| 320 | else if ((Char == "U0031") or (Char == "SN__1")) |
|---|
| 321 | UniSum := UniSum . "1" |
|---|
| 322 | else if ((Char == "U0032") or (Char == "SN__2")) |
|---|
| 323 | UniSum := UniSum . "2" |
|---|
| 324 | else if ((Char == "U0033") or (Char == "SN__3")) |
|---|
| 325 | UniSum := UniSum . "3" |
|---|
| 326 | else if ((Char == "U0034") or (Char == "SN__4")) |
|---|
| 327 | UniSum := UniSum . "4" |
|---|
| 328 | else if ((Char == "U0035") or (Char == "SN__5")) |
|---|
| 329 | UniSum := UniSum . "5" |
|---|
| 330 | else if ((Char == "U0036") or (Char == "SN__6")) |
|---|
| 331 | UniSum := UniSum . "6" |
|---|
| 332 | else if ((Char == "U0037") or (Char == "SN__7")) |
|---|
| 333 | UniSum := UniSum . "7" |
|---|
| 334 | else if ((Char == "U0038") or (Char == "SN__8")) |
|---|
| 335 | UniSum := UniSum . "8" |
|---|
| 336 | else if ((Char == "U0039") or (Char == "SN__9")) |
|---|
| 337 | UniSum := UniSum . "9" |
|---|
| 338 | else if ((Char == "U0041") or (Char == "U0061")) |
|---|
| 339 | UniSum := UniSum . "A" |
|---|
| 340 | else if ((Char == "U0042") or (Char == "U0062")) |
|---|
| 341 | UniSum := UniSum . "B" |
|---|
| 342 | else if ((Char == "U0043") or (Char == "U0063")) |
|---|
| 343 | UniSum := UniSum . "C" |
|---|
| 344 | else if ((Char == "U0044") or (Char == "U0064")) |
|---|
| 345 | UniSum := UniSum . "D" |
|---|
| 346 | else if ((Char == "U0045") or (Char == "U0065")) |
|---|
| 347 | UniSum := UniSum . "E" |
|---|
| 348 | else if ((Char == "U0046") or (Char == "U0066")) |
|---|
| 349 | UniSum := UniSum . "F" |
|---|
| 350 | else if ((Char == "U000D") or (Char == "U0020")) { |
|---|
| 351 | UniSum := "U" . SubStr("0000" . UniSum, -3) |
|---|
| 352 | PP%PhysKey% := UniSum |
|---|
| 353 | PR%PhysKey% := UniSum |
|---|
| 354 | CharOutDown(UniSum) |
|---|
| 355 | IsPressHooked := 0 |
|---|
| 356 | } else |
|---|
| 357 | IsPressHooked := 0 |
|---|
| 358 | } else if (HookRoutine == "DUni") { |
|---|
| 359 | OutStr := EncodeUni(Char) |
|---|
| 360 | loop { |
|---|
| 361 | if (OutStr == "") |
|---|
| 362 | break ; erledigt |
|---|
| 363 | CharOut(SubStr(OutStr,1,5)) |
|---|
| 364 | OutStr := SubStr(OutStr,6) |
|---|
| 365 | } |
|---|
| 366 | IsPressHooked := 0 |
|---|
| 367 | } else |
|---|
| 368 | IsPressHooked := 0 |
|---|
| 369 | } |
|---|
| 370 | |
|---|
| 371 | GenRomanDigit(Pos, DigitIs, DigitTest, str0, str1, str2, str3, str4, str5) { |
|---|
| 372 | res := "" |
|---|
| 373 | if (DigitIs == DigitTest) |
|---|
| 374 | res := str%Pos% |
|---|
| 375 | return res |
|---|
| 376 | } |
|---|
| 377 | |
|---|
| 378 | EncodeUni(str) { |
|---|
| 379 | SetFormat, Integer, hex |
|---|
| 380 | ; MsgBox % Asc(SubStr(str,1,1)) . Asc(SubStr(str,2,1)) |
|---|
| 381 | result := "" |
|---|
| 382 | loop { |
|---|
| 383 | char := SubStr(str,1,1) |
|---|
| 384 | str := SubStr(str,2) |
|---|
| 385 | if (asc(char) < 0x80) |
|---|
| 386 | result := result . "U00" . SubStr(asc(char),3) |
|---|
| 387 | else if (asc(char) < 0xC0) { |
|---|
| 388 | ; error |
|---|
| 389 | } else if (asc(char) < 0xE0) { |
|---|
| 390 | char2 := Substr(str,1,1) |
|---|
| 391 | str := SubStr(str,2) |
|---|
| 392 | if ((asc(char2) < 0x80) or (asc(char2) > 0xBF)) { |
|---|
| 393 | ; error |
|---|
| 394 | } else { |
|---|
| 395 | result := result . "U" . SubStr("0000" . SubStr((((asc(char) & 0x1F) << 6) + (asc(char2) & 0x3F)),3),-3) |
|---|
| 396 | } |
|---|
| 397 | } else if (asc(char) < 0xF8) { |
|---|
| 398 | char2 := SubStr(str,1,1) |
|---|
| 399 | char3 := SubStr(str,2,1) |
|---|
| 400 | str := SubStr(str,3) |
|---|
| 401 | ; MsgBox % "chars: " . char . ", " . char2 . ", " . char3 . ", str: " . str |
|---|
| 402 | if ((asc(char2) < 0x80) or (asc(char2) > 0xBF) |
|---|
| 403 | or (asc(char3) < 0x80) or (asc(char3) > 0xBF)) { |
|---|
| 404 | ; error |
|---|
| 405 | } else { |
|---|
| 406 | ; MsgBox % asc(char) . asc(char2) . asc(char3) |
|---|
| 407 | ; MsgBox % (((asc(char) & 0x0F) << 12) + ((asc(char2) & 0x3F) << 6) + (asc(char3) & 0x3F)) |
|---|
| 408 | result := result . "U" . SubStr("0000" . SubStr((((asc(char) & 0x0F) << 12) + ((asc(char2) & 0x3F) << 6) + (asc(char3) & 0x3F)),3),-3) |
|---|
| 409 | } |
|---|
| 410 | } |
|---|
| 411 | if (str == "") |
|---|
| 412 | break |
|---|
| 413 | } |
|---|
| 414 | SetFormat, Integer, d |
|---|
| 415 | StringUpper,result,result |
|---|
| 416 | return result |
|---|
| 417 | } |
|---|
| 418 | |
|---|