| 1 | ; -*- encoding:utf-8 -*- |
|---|
| 2 | |
|---|
| 3 | BSTNguiErstellt := 0 |
|---|
| 4 | BSTNalwaysOnTop := 1 |
|---|
| 5 | |
|---|
| 6 | UnZipLocalFile := ResourceFolder . "\unzip.exe" |
|---|
| 7 | UnZipSourceLink := "http://stahlworks.com/dev/unzip.exe" |
|---|
| 8 | |
|---|
| 9 | UniFontVersion := "2.30" |
|---|
| 10 | UniFontFilename := "DejaVuSans-Bold.ttf" |
|---|
| 11 | UniFontName := "DejaVu Sans" |
|---|
| 12 | |
|---|
| 13 | UniFontZipFilename := "dejavu-fonts-ttf-" . UniFontVersion . ".zip" |
|---|
| 14 | UniFontZipLocalFile := ResourceFolder . "\" . UniFontZipFilename |
|---|
| 15 | |
|---|
| 16 | UniFontZipSourceLink := "http://downloads.sourceforge.net/project/dejavu/dejavu/" . UniFontVersion . "/" . UniFontZipFilename |
|---|
| 17 | |
|---|
| 18 | UniFontLocalFilePath := ApplicationFolder |
|---|
| 19 | UniFontLocalFile := UniFontLocalFilePath . "/" . UniFontFilename |
|---|
| 20 | UniFontZipFontPath := "dejavu-fonts-ttf-" . UniFontVersion . "/ttf/" . UniFontFilename |
|---|
| 21 | |
|---|
| 22 | BSTNUpdate() { |
|---|
| 23 | global |
|---|
| 24 | static WM_SETTEXT := 0x0C |
|---|
| 25 | { |
|---|
| 26 | VarSetCapacity(ptrU,20) |
|---|
| 27 | loop,parse,GuiKeyList,`, |
|---|
| 28 | { |
|---|
| 29 | GuiPhysKey := A_LoopField |
|---|
| 30 | if (EbeneC<3) { |
|---|
| 31 | if (NOC%GuiPhysKey%==1) { |
|---|
| 32 | GuiEb := EbeneNC |
|---|
| 33 | } else { |
|---|
| 34 | GuiEb := EbeneC |
|---|
| 35 | } |
|---|
| 36 | } else |
|---|
| 37 | GuiEb := EbeneC |
|---|
| 38 | CurrentComp := Comp |
|---|
| 39 | GuiComp := "" |
|---|
| 40 | rerun_bstnupdate: |
|---|
| 41 | GuiComp1 := CurrentComp . CP%GuiEb%%GuiPhysKey% |
|---|
| 42 | if (GSYM%GuiComp1% != "") { |
|---|
| 43 | GuiComp .= GSYM%GuiComp1% |
|---|
| 44 | } else if (CD%GuiComp1% != "") { |
|---|
| 45 | GuiComp .= CD%GuiComp1% |
|---|
| 46 | } else if (CM%GuiComp1% == 1) { |
|---|
| 47 | GuiComp .= "U00002AU00002A" |
|---|
| 48 | } else if (CF%CurrentComp% != "") { |
|---|
| 49 | if (IM%GuiPhysKey% != 1) |
|---|
| 50 | GuiComp .= CF%CurrentComp% |
|---|
| 51 | CurrentComp := "" |
|---|
| 52 | goto rerun_bstnupdate |
|---|
| 53 | } else if (CurrentComp = "") { |
|---|
| 54 | GuiComp .= GuiComp1 |
|---|
| 55 | } |
|---|
| 56 | GuiPos := 0 |
|---|
| 57 | loop { |
|---|
| 58 | if (GuiComp=="") |
|---|
| 59 | break |
|---|
| 60 | if (SubStr(GuiComp,1,1)=="U") { |
|---|
| 61 | Charcode := "0x" . Substr(GuiComp,2,6) |
|---|
| 62 | if (charCode < 0x10000) { |
|---|
| 63 | NumPut(CharCode, ptrU, GuiPos, "UShort") |
|---|
| 64 | } else { |
|---|
| 65 | ; surrogates |
|---|
| 66 | NumPut(0xD800|((charCode-0x10000)/1024) , ptrU, GuiPos, "UShort") |
|---|
| 67 | GuiPos := GuiPos + 2 |
|---|
| 68 | NumPut(0xDC00|((charCode-0x10000)&0x3FF), ptrU, GuiPos, "UShort") |
|---|
| 69 | } |
|---|
| 70 | GuiPos := GuiPos + 2 |
|---|
| 71 | } |
|---|
| 72 | GuiComp := SubStr(GuiComp,8) |
|---|
| 73 | } |
|---|
| 74 | NumPut(0x0 ,ptrU,GuiPos,"UShort") ; End of string |
|---|
| 75 | DllCall("SendMessageW", "UInt",GuiKey%GuiPhysKey%, "UInt",WM_SETTEXT, "UInt",0, "Uint",&ptrU) |
|---|
| 76 | } |
|---|
| 77 | } |
|---|
| 78 | GuiControl,MoveDraw,Picture0 |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | GuiAddKeyS(sc,x,y) { |
|---|
| 82 | global |
|---|
| 83 | GuiAddKey(vksc%sc%,x,y) |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | GuiAddKeySM(sc,x,y) { |
|---|
| 87 | global |
|---|
| 88 | vksc := vksc%sc% |
|---|
| 89 | IM%vksc% := 1 |
|---|
| 90 | GuiAddKey(vksc,x,y) |
|---|
| 91 | } |
|---|
| 92 | |
|---|
| 93 | GuiAddKeySN(sc,x,y) { |
|---|
| 94 | global |
|---|
| 95 | GuiAddKey(vkscn1%sc%,x,y) |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | GuiAddKey(key,x,y) { |
|---|
| 99 | global |
|---|
| 100 | x:=x-4 |
|---|
| 101 | y:=y-10 |
|---|
| 102 | Gui, Add, Text, x%x% y%y% w38 h38 Center 0x200 hwndGuiKey%key% BackgroundTrans |
|---|
| 103 | GuiKeyList := GuiKeyList . key . "," |
|---|
| 104 | } |
|---|
| 105 | |
|---|
| 106 | CharProc_BSTNt() { |
|---|
| 107 | global |
|---|
| 108 | ; Bildschirmtastatur togglen |
|---|
| 109 | useBSTN := !(useBSTN) |
|---|
| 110 | if (useBSTN) |
|---|
| 111 | CharProc_BSTN1() |
|---|
| 112 | else |
|---|
| 113 | CharProc_BSTN0() |
|---|
| 114 | } |
|---|
| 115 | |
|---|
| 116 | BSTNOnClose() { |
|---|
| 117 | global |
|---|
| 118 | useBSTN := 0 |
|---|
| 119 | CharProc_BSTN0() |
|---|
| 120 | } |
|---|
| 121 | |
|---|
| 122 | CharProc_BSTN0() { |
|---|
| 123 | global |
|---|
| 124 | GuiCurrent := "" |
|---|
| 125 | Gui, Destroy |
|---|
| 126 | DllCall( "GDI32.DLL\RemoveFontResourceEx", Str, UniFontLocalFile ,UInt,(FR_PRIVATE:=0x10), Int,0) |
|---|
| 127 | } |
|---|
| 128 | |
|---|
| 129 | CharProc_BSTN1() { |
|---|
| 130 | global |
|---|
| 131 | if (GuiCurrent!="") |
|---|
| 132 | %GuiCurrent%OnClose() |
|---|
| 133 | |
|---|
| 134 | if (FileExist(ResourceFolder)!="") { |
|---|
| 135 | FileInstall,ebene0.png,%ResourceFolder%\ebene0.png,1 |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | if (FileExist(UniFontLocalFile)=="") { |
|---|
| 139 | if (FileExist(UnZipLocalFile)=="") { |
|---|
| 140 | Progress,0,,Herunterladen des Entpack-Programms ... |
|---|
| 141 | UrlDownloadToFile,%UnZipSourceLink%,%UnZipLocalFile% |
|---|
| 142 | if (FileExist(UnZipLocalFile)=="") { |
|---|
| 143 | Msgbox,Konnte Unzip-Programm nicht finden und nicht installieren! |
|---|
| 144 | } |
|---|
| 145 | } |
|---|
| 146 | |
|---|
| 147 | if (FileExist(UniFontZipLocalFile)=="") { |
|---|
| 148 | Progress,20,Herunterladen des Fonts ... |
|---|
| 149 | UrlDownloadToFile,%UniFontZipSourceLink%,%UniFontZipLocalFile% |
|---|
| 150 | } |
|---|
| 151 | |
|---|
| 152 | Progress,80,Entpacken des Archivs ... |
|---|
| 153 | RunWait,% """" . UnZipLocalFile . """ -j """ . UniFontZipLocalFile . """ """ . UniFontZipFontPath . """",%UniFontLocalFilePath%,Hide |
|---|
| 154 | Progress,OFF |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | DllCall( "GDI32.DLL\AddFontResourceEx", Str, UniFontLocalFile ,UInt,(FR_PRIVATE:=0x10), Int,0) |
|---|
| 158 | |
|---|
| 159 | |
|---|
| 160 | SysGet, WorkArea, MonitorWorkArea |
|---|
| 161 | yPosition := WorkAreaBottom - 230 |
|---|
| 162 | Gui, Color, FFFFFF |
|---|
| 163 | Gui, Add, Picture,AltSubmit x0 y0 vPicture0, % ResourceFolder . "\ebene0.png" |
|---|
| 164 | Gui, Font, s12 bold, %UniFontName% |
|---|
| 165 | GuiKeyList := "" |
|---|
| 166 | GuiAddKeyS("029",6,9) |
|---|
| 167 | GuiAddKeyS("002",44,9) |
|---|
| 168 | GuiAddKeyS("003",82,9) |
|---|
| 169 | GuiAddKeyS("004",120,9) |
|---|
| 170 | GuiAddKeyS("005",158,9) |
|---|
| 171 | GuiAddKeyS("006",196,9) |
|---|
| 172 | GuiAddKeyS("007",234,9) |
|---|
| 173 | GuiAddKeyS("008",272,9) |
|---|
| 174 | GuiAddKeyS("009",310,9) |
|---|
| 175 | GuiAddKeyS("00A",348,9) |
|---|
| 176 | GuiAddKeyS("00B",386,9) |
|---|
| 177 | GuiAddKeyS("00C",424,9) |
|---|
| 178 | GuiAddKeyS("00D",462,9) |
|---|
| 179 | GuiAddKey("backspace",510,9) |
|---|
| 180 | |
|---|
| 181 | GuiAddKey("tab",10,48) |
|---|
| 182 | GuiAddKeyS("010",58,48) |
|---|
| 183 | GuiAddKeyS("011",96,48) |
|---|
| 184 | GuiAddKeyS("012",134,48) |
|---|
| 185 | GuiAddKeyS("013",172,48) |
|---|
| 186 | GuiAddKeyS("014",210,48) |
|---|
| 187 | GuiAddKeyS("015",248,48) |
|---|
| 188 | GuiAddKeyS("016",286,48) |
|---|
| 189 | GuiAddKeyS("017",324,48) |
|---|
| 190 | GuiAddKeyS("018",362,48) |
|---|
| 191 | GuiAddKeyS("019",400,48) |
|---|
| 192 | GuiAddKeyS("01A",438,48) |
|---|
| 193 | GuiAddKeyS("01B",476,48) |
|---|
| 194 | GuiAddKey("enter",526,68) |
|---|
| 195 | |
|---|
| 196 | GuiAddKeySM("03A",18,88) |
|---|
| 197 | GuiAddKeyS("01E",75,88) |
|---|
| 198 | GuiAddKeyS("01F",113,88) |
|---|
| 199 | GuiAddKeyS("020",151,88) |
|---|
| 200 | GuiAddKeyS("021",189,88) |
|---|
| 201 | GuiAddKeyS("022",227,88) |
|---|
| 202 | GuiAddKeyS("023",265,88) |
|---|
| 203 | GuiAddKeyS("024",303,88) |
|---|
| 204 | GuiAddKeyS("025",341,88) |
|---|
| 205 | GuiAddKeyS("026",379,88) |
|---|
| 206 | GuiAddKeyS("027",417,88) |
|---|
| 207 | GuiAddKeyS("028",455,88) |
|---|
| 208 | GuiAddKeySM("02B",493,88) |
|---|
| 209 | |
|---|
| 210 | GuiAddKeySM("02A",8,128) |
|---|
| 211 | GuiAddKeySM("056",50,128) |
|---|
| 212 | GuiAddKeyS("02C",88,128) |
|---|
| 213 | GuiAddKeyS("02D",126,128) |
|---|
| 214 | GuiAddKeyS("02E",164,128) |
|---|
| 215 | GuiAddKeyS("02F",202,128) |
|---|
| 216 | GuiAddKeyS("030",240,128) |
|---|
| 217 | GuiAddKeyS("031",278,128) |
|---|
| 218 | GuiAddKeyS("032",316,128) |
|---|
| 219 | GuiAddKeyS("033",354,128) |
|---|
| 220 | GuiAddKeyS("034",392,128) |
|---|
| 221 | GuiAddKeyS("035",430,128) |
|---|
| 222 | GuiAddKeySM("136",498,128) |
|---|
| 223 | |
|---|
| 224 | GuiAddKey("space",264,168) |
|---|
| 225 | GuiAddKeySM("138",430,168) |
|---|
| 226 | |
|---|
| 227 | GuiAddKeyS("145",582,9) |
|---|
| 228 | GuiAddKeyS("135",620,9) |
|---|
| 229 | GuiAddKeyS("037",658,9) |
|---|
| 230 | GuiAddKeyS("04A",696,9) |
|---|
| 231 | |
|---|
| 232 | GuiAddKeySN("047",582,48) |
|---|
| 233 | GuiAddKeySN("048",620,48) |
|---|
| 234 | GuiAddKeySN("049",658,48) |
|---|
| 235 | GuiAddKeyS("04E",696,68) |
|---|
| 236 | |
|---|
| 237 | GuiAddKeySN("04B",582,88) |
|---|
| 238 | GuiAddKeySN("04C",620,88) |
|---|
| 239 | GuiAddKeySN("04D",658,88) |
|---|
| 240 | |
|---|
| 241 | GuiAddKeySN("04F",582,128) |
|---|
| 242 | GuiAddKeySN("050",620,128) |
|---|
| 243 | GuiAddKeySN("051",658,128) |
|---|
| 244 | GuiAddKey("numpadenter",696,148) |
|---|
| 245 | |
|---|
| 246 | GuiAddKeySN("052",601,168) |
|---|
| 247 | GuiAddKeySN("053",658,168) |
|---|
| 248 | Gui, +AlwaysOnTop +ToolWindow |
|---|
| 249 | Gui, Show, y%yposition% w729 h199 NoActivate, NEO-Bildschirmtastatur (neu!) |
|---|
| 250 | BSTNUpdate() |
|---|
| 251 | BSTNalwaysOnTop := 1 |
|---|
| 252 | GuiCurrent := "BSTN" |
|---|
| 253 | } |
|---|
| 254 | |
|---|
| 255 | BSTNToggleAlwaysOnTop() { |
|---|
| 256 | global |
|---|
| 257 | if (BSTNalwaysOnTop) { |
|---|
| 258 | Gui, -AlwaysOnTop |
|---|
| 259 | BSTNalwaysOnTop := 0 |
|---|
| 260 | } else { |
|---|
| 261 | Gui, +AlwaysOnTop |
|---|
| 262 | BSTNalwaysOnTop := 1 |
|---|
| 263 | } |
|---|
| 264 | } |
|---|
| 265 | |
|---|
| 266 | CharProc_BSTNA() { |
|---|
| 267 | global |
|---|
| 268 | ; Bildschirmtastatur AlwaysOnTop |
|---|
| 269 | if (BSTNguiErstellt) |
|---|
| 270 | BSTNToggleAlwaysOnTop() |
|---|
| 271 | } |
|---|
| 272 | |
|---|
| 273 | GUISYM(sym,chars) { |
|---|
| 274 | global |
|---|
| 275 | GSYM%sym% := EncodeUniComposeA(chars) |
|---|
| 276 | } |
|---|
| 277 | |
|---|
| 278 | BSTNSymbols() { |
|---|
| 279 | global |
|---|
| 280 | ; diverse Symbole für Spezialzeichen |
|---|
| 281 | GUISYM("T__cflx","◌̂") |
|---|
| 282 | GUISYM("T__cron","◌̌") |
|---|
| 283 | GUISYM("T__turn","↻") |
|---|
| 284 | GUISYM("T__abdt","◌̇") |
|---|
| 285 | GUISYM("T__hook","◌˞") ; not perfect |
|---|
| 286 | GUISYM("T__bldt",".") ; not perfect |
|---|
| 287 | |
|---|
| 288 | GUISYM("T__grav","◌̀") |
|---|
| 289 | GUISYM("T__cedi","◌̧") |
|---|
| 290 | GUISYM("T__obrg","◌̊") |
|---|
| 291 | GUISYM("T__drss","◌̈") |
|---|
| 292 | GUISYM("U001FFE","◌῾") ; not perfect |
|---|
| 293 | GUISYM("T__mcrn","◌̄") |
|---|
| 294 | |
|---|
| 295 | GUISYM("T__acut","◌́") |
|---|
| 296 | GUISYM("T__tlde","◌̃") |
|---|
| 297 | GUISYM("T__strk","◌̷") |
|---|
| 298 | GUISYM("T__dbac","◌̋") |
|---|
| 299 | GUISYM("U001FBF","◌᾿") ; not perfect |
|---|
| 300 | GUISYM("U0002D8","◌̆") |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | |
|---|
| 304 | GUISYM("S__Sh_L","⇧") |
|---|
| 305 | GUISYM("S__Sh_R","⇧") |
|---|
| 306 | GUISYM("S__Caps","⇪") |
|---|
| 307 | GUISYM("S___Del","⌦") |
|---|
| 308 | GUISYM("S___Ins","⎀") |
|---|
| 309 | GUISYM("S____Up","⇡") |
|---|
| 310 | GUISYM("S__Down","⇣") |
|---|
| 311 | GUISYM("S__Rght","⇢") |
|---|
| 312 | GUISYM("S__Left","⇠") |
|---|
| 313 | GUISYM("S__PgUp","⇞") |
|---|
| 314 | GUISYM("S__PgDn","⇟") |
|---|
| 315 | GUISYM("S__Home","↸") |
|---|
| 316 | GUISYM("S___End","⇲") |
|---|
| 317 | |
|---|
| 318 | GUISYM("S__N__0","0") |
|---|
| 319 | GUISYM("S__N__1","1") |
|---|
| 320 | GUISYM("S__N__2","2") |
|---|
| 321 | GUISYM("S__N__3","3") |
|---|
| 322 | GUISYM("S__N__4","4") |
|---|
| 323 | GUISYM("S__N__5","5") |
|---|
| 324 | GUISYM("S__N__6","6") |
|---|
| 325 | GUISYM("S__N__7","7") |
|---|
| 326 | GUISYM("S__N__8","8") |
|---|
| 327 | GUISYM("S__N__9","9") |
|---|
| 328 | GUISYM("S__NDiv","÷") |
|---|
| 329 | GUISYM("S__NMul","×") |
|---|
| 330 | GUISYM("S__NSub","-") |
|---|
| 331 | GUISYM("S__NAdd","+") |
|---|
| 332 | GUISYM("S__NDot",",") |
|---|
| 333 | GUISYM("S__NEnt","⏎") |
|---|
| 334 | |
|---|
| 335 | GUISYM("S__NDel","⌦") |
|---|
| 336 | GUISYM("S__NIns","⎀") |
|---|
| 337 | GUISYM("S__N_Up","⇡") |
|---|
| 338 | GUISYM("S__N_Dn","⇣") |
|---|
| 339 | GUISYM("S__N_Ri","⇢") |
|---|
| 340 | GUISYM("S__N_Le","⇠") |
|---|
| 341 | GUISYM("S__NPUp","⇞") |
|---|
| 342 | GUISYM("S__NPDn","⇟") |
|---|
| 343 | GUISYM("S__NHom","↸") |
|---|
| 344 | GUISYM("S__NEnd","⇲") |
|---|
| 345 | |
|---|
| 346 | GUISYM("S_SNDel","⌦") |
|---|
| 347 | GUISYM("S_SNIns","⎀") |
|---|
| 348 | GUISYM("S_SN_Up","⇡") |
|---|
| 349 | GUISYM("S_SN_Dn","⇣") |
|---|
| 350 | GUISYM("S_SN_Ri","⇢") |
|---|
| 351 | GUISYM("S_SN_Le","⇠") |
|---|
| 352 | GUISYM("S_SNPUp","⇞") |
|---|
| 353 | GUISYM("S_SNPDn","⇟") |
|---|
| 354 | GUISYM("S_SNHom","↸") |
|---|
| 355 | GUISYM("S_SNEnd","⇲") |
|---|
| 356 | |
|---|
| 357 | GUISYM("U00001B","⌧") |
|---|
| 358 | GUISYM("U000008","⌫") |
|---|
| 359 | GUISYM("U000009","↹") |
|---|
| 360 | GUISYM("U00000D","⏎") |
|---|
| 361 | |
|---|
| 362 | GUISYM("P__M2LD","⇧") |
|---|
| 363 | GUISYM("P__M2RD","⇧") |
|---|
| 364 | GUISYM("P__M3LD","M3") |
|---|
| 365 | GUISYM("P__M3RD","M3") |
|---|
| 366 | GUISYM("P__M4LD","M4") |
|---|
| 367 | GUISYM("P__M4RD","M4") |
|---|
| 368 | |
|---|
| 369 | GUISYM("U000020","␣") |
|---|
| 370 | GUISYM("U0000A0","⍽") |
|---|
| 371 | GUISYM("U00202F",">⍽<") |
|---|
| 372 | } |
|---|
| 373 | |
|---|
| 374 | BSTNRegister() { |
|---|
| 375 | global |
|---|
| 376 | |
|---|
| 377 | CP3F2 := "P_BSTNt" |
|---|
| 378 | BSTNSymbols() |
|---|
| 379 | |
|---|
| 380 | IniRead,useBSTN,%ini%,Global,useBSTN,0 |
|---|
| 381 | if (useBSTN) |
|---|
| 382 | CharProc_BSTN1() |
|---|
| 383 | } |
|---|
| 384 | |
|---|
| 385 | BSTNRegister() |
|---|