Bildschirmtastatur mal anders ;)

  • Hey Leute,

    ich meld mich auch mal wieder mit einem kleinen Skript. Und zwar finde ich die M$ Bildschirmtastatur etwas....unpraktisch ;)

    Deshalb hab ich mir gedacht, wozu gibt es denn das Mausrad?

    Also hier ist das Ergebnis, man scrollt durch die Buchstaben und wenn man auf das Rad drückt, dann wird der Buchstabe gesendet, aber ich hab keine Ahnung, wie ich es hinbekommen soll, dass ich auf ein anderes Fenster klicken kann und die Tastatur trotzdem noch zu sehen ist, aber nicht das aktive Fenster ist.

    Achja, ihr braucht noch die MouseOnEvent.au3 und die Schriftart Century Gothic

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include "MouseOnEvent.au3"
    HotKeySet("{ESC}","ENDE")
    Dim $brushes[26]
    Global $aktuellerBrush = 0
    $Gui = GUICreate("",1366,100,0,@DesktopHeight-100,$WS_POPUPWINDOW)
    _GDIPlus_Startup()
    $brushBlau = _GDIPlus_BrushCreateSolid(0xFF79ABFF)
    $brushSchwarz = _GDIPlus_BrushCreateSolid(0xFF000000)
    $brushes[0] = $brushBlau
    For $i = 1 To 25
    $brushes[$i] = $brushSchwarz
    Next
    $format = _GDIPlus_StringFormatCreate()
    $fontFamily = _GDIPlus_FontFamilyCreate("Century Gothic")
    $font = _GDIPlus_FontCreate($fontFamily,60)
    $layoutA = _GDIPlus_RectFCreate(10,0,100,100)
    $layoutB = _GDIPlus_RectFCreate(80,0,100,100)
    $layoutC = _GDIPlus_RectFCreate(130,0,100,100)
    $layoutD = _GDIPlus_RectFCreate(200,0,100,100)
    $layoutE = _GDIPlus_RectFCreate(260,0,100,100)
    $layoutF = _GDIPlus_RectFCreate(300,0,100,100)
    $layoutG = _GDIPlus_RectFCreate(340,0,100,100)
    $layoutH = _GDIPlus_RectFCreate(410,0,100,100)
    $layoutI = _GDIPlus_RectFCreate(460,0,100,100)
    $layoutJ = _GDIPlus_RectFCreate(480,0,100,100)
    $layoutK = _GDIPlus_RectFCreate(510,0,100,100)
    $layoutL = _GDIPlus_RectFCreate(560,0,100,100)
    $layoutM = _GDIPlus_RectFCreate(600,0,100,100)
    $layoutN = _GDIPlus_RectFCreate(670,0,100,100)
    $layoutO = _GDIPlus_RectFCreate(730,0,100,100)
    $layoutP = _GDIPlus_RectFCreate(800,0,100,100)
    $layoutQ = _GDIPlus_RectFCreate(850,0,100,100)
    $layoutR = _GDIPlus_RectFCreate(920,0,100,100)
    $layoutS = _GDIPlus_RectFCreate(970,0,100,100)
    $layoutT = _GDIPlus_RectFCreate(1010,0,100,100)
    $layoutU = _GDIPlus_RectFCreate(1040,0,100,100)
    $layoutV = _GDIPlus_RectFCreate(1090,0,100,100)
    $layoutW = _GDIPlus_RectFCreate(1150,0,100,100)
    $layoutX = _GDIPlus_RectFCreate(1220,0,100,100)
    $layoutY = _GDIPlus_RectFCreate(1270,0,100,100)
    $layoutZ = _GDIPlus_RectFCreate(1315,0,100,100)
    $graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(1366, 100, $graphic)
    $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    GUISetState()
    _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT,"runter")
    _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT,"rauf")
    _MouseSetOnEvent($MOUSE_WHEELDOWN_EVENT,"klick")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3
    ENDE()
    EndSwitch
    _BuchstabenMalen()
    _GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, -10, 0, 1376, 100)
    WEnd
    Func runter()
    If $aktuellerBrush < 25 Then
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush += 1
    $brushes[$aktuellerBrush] = $brushBlau
    Else
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush = 0
    $brushes[$aktuellerBrush] = $brushBlau
    EndIf
    EndFunc
    Func rauf()
    If $aktuellerBrush > 1 Then
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush -= 1
    $brushes[$aktuellerBrush] = $brushBlau
    Else
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush = 25
    $brushes[$aktuellerBrush] = $brushBlau
    EndIf
    EndFunc
    Func _BuchstabenMalen()
    _GDIPlus_GraphicsDrawStringEx($buffer,"A",$font,$layoutA,$format,$brushes[0])
    _GDIPlus_GraphicsDrawStringEx($buffer,"B",$font,$layoutB,$format,$brushes[1])
    _GDIPlus_GraphicsDrawStringEx($buffer,"C",$font,$layoutC,$format,$brushes[2])
    _GDIPlus_GraphicsDrawStringEx($buffer,"D",$font,$layoutD,$format,$brushes[3])
    _GDIPlus_GraphicsDrawStringEx($buffer,"E",$font,$layoutE,$format,$brushes[4])
    _GDIPlus_GraphicsDrawStringEx($buffer,"F",$font,$layoutF,$format,$brushes[5])
    _GDIPlus_GraphicsDrawStringEx($buffer,"G",$font,$layoutG,$format,$brushes[6])
    _GDIPlus_GraphicsDrawStringEx($buffer,"H",$font,$layoutH,$format,$brushes[7])
    _GDIPlus_GraphicsDrawStringEx($buffer,"I",$font,$layoutI,$format,$brushes[8])
    _GDIPlus_GraphicsDrawStringEx($buffer,"J",$font,$layoutJ,$format,$brushes[9])
    _GDIPlus_GraphicsDrawStringEx($buffer,"K",$font,$layoutK,$format,$brushes[10])
    _GDIPlus_GraphicsDrawStringEx($buffer,"L",$font,$layoutL,$format,$brushes[11])
    _GDIPlus_GraphicsDrawStringEx($buffer,"M",$font,$layoutM,$format,$brushes[12])
    _GDIPlus_GraphicsDrawStringEx($buffer,"N",$font,$layoutN,$format,$brushes[13])
    _GDIPlus_GraphicsDrawStringEx($buffer,"O",$font,$layoutO,$format,$brushes[14])
    _GDIPlus_GraphicsDrawStringEx($buffer,"P",$font,$layoutP,$format,$brushes[15])
    _GDIPlus_GraphicsDrawStringEx($buffer,"Q",$font,$layoutQ,$format,$brushes[16])
    _GDIPlus_GraphicsDrawStringEx($buffer,"R",$font,$layoutR,$format,$brushes[17])
    _GDIPlus_GraphicsDrawStringEx($buffer,"S",$font,$layoutS,$format,$brushes[18])
    _GDIPlus_GraphicsDrawStringEx($buffer,"T",$font,$layoutT,$format,$brushes[19])
    _GDIPlus_GraphicsDrawStringEx($buffer,"U",$font,$layoutU,$format,$brushes[20])
    _GDIPlus_GraphicsDrawStringEx($buffer,"V",$font,$layoutV,$format,$brushes[21])
    _GDIPlus_GraphicsDrawStringEx($buffer,"W",$font,$layoutW,$format,$brushes[22])
    _GDIPlus_GraphicsDrawStringEx($buffer,"X",$font,$layoutX,$format,$brushes[23])
    _GDIPlus_GraphicsDrawStringEx($buffer,"Y",$font,$layoutY,$format,$brushes[24])
    _GDIPlus_GraphicsDrawStringEx($buffer,"Z",$font,$layoutZ,$format,$brushes[25])
    EndFunc
    Func klick()
    Switch $aktuellerBrush
    Case 0
    Send("A")
    Case 1
    Send("B")
    Case 2
    Send("C")
    Case 3
    Send("D")
    Case 4
    Send("E")
    Case 5
    Send("F")
    Case 6
    Send("G")
    Case 7
    Send("H")
    Case 8
    Send("I")
    Case 9
    Send("J")
    Case 10
    Send("K")
    Case 11
    Send("L")
    Case 12
    Send("M")
    Case 13
    Send("N")
    Case 14
    Send("O")
    Case 15
    Send("P")
    Case 16
    Send("Q")
    Case 17
    Send("R")
    Case 18
    Send("S")
    Case 19
    Send("T")
    Case 20
    Send("U")
    Case 21
    Send("V")
    Case 22
    Send("W")
    Case 23
    Send("X")
    Case 24
    Send("Y")
    Case 25
    Send("Z")
    EndSwitch
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func ENDE()
    _GDIPlus_BrushDispose($brushBlau)
    _GDIPlus_GraphicsDispose($buffer)
    _GDIPlus_GraphicsDispose($graphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    DFPWare

  • Wir brauchen vor allem das passende Font :rolleyes: ...
    Ich hab das ganze mal ein wenig überarbeitet, aber da lässt sich definitiv noch einiges verbessern.

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include "MouseOnEvent.au3"
    HotKeySet("{ESC}", "ENDE")
    Dim $brushes[26]
    Global $aktuellerBrush = 0
    $Gui = GUICreate("", 1366, 100, 0, @DesktopHeight - 100, $WS_POPUPWINDOW)
    _GDIPlus_Startup()
    $brushBlau = _GDIPlus_BrushCreateSolid(0xFF79ABFF)
    $brushSchwarz = _GDIPlus_BrushCreateSolid(0xFF000000)
    $brushes[0] = $brushBlau
    For $i = 1 To 25
    $brushes[$i] = $brushSchwarz
    Next
    $format = _GDIPlus_StringFormatCreate()
    $fontFamily = _GDIPlus_FontFamilyCreate("Century Gothic")
    $font = _GDIPlus_FontCreate($fontFamily, 60)
    $layoutA = _GDIPlus_RectFCreate(10, 0, 100, 100)
    $layoutB = _GDIPlus_RectFCreate(80, 0, 100, 100)
    $layoutC = _GDIPlus_RectFCreate(130, 0, 100, 100)
    $layoutD = _GDIPlus_RectFCreate(200, 0, 100, 100)
    $layoutE = _GDIPlus_RectFCreate(260, 0, 100, 100)
    $layoutF = _GDIPlus_RectFCreate(300, 0, 100, 100)
    $layoutG = _GDIPlus_RectFCreate(340, 0, 100, 100)
    $layoutH = _GDIPlus_RectFCreate(410, 0, 100, 100)
    $layoutI = _GDIPlus_RectFCreate(460, 0, 100, 100)
    $layoutJ = _GDIPlus_RectFCreate(480, 0, 100, 100)
    $layoutK = _GDIPlus_RectFCreate(510, 0, 100, 100)
    $layoutL = _GDIPlus_RectFCreate(560, 0, 100, 100)
    $layoutM = _GDIPlus_RectFCreate(600, 0, 100, 100)
    $layoutN = _GDIPlus_RectFCreate(670, 0, 100, 100)
    $layoutO = _GDIPlus_RectFCreate(730, 0, 100, 100)
    $layoutP = _GDIPlus_RectFCreate(800, 0, 100, 100)
    $layoutQ = _GDIPlus_RectFCreate(850, 0, 100, 100)
    $layoutR = _GDIPlus_RectFCreate(920, 0, 100, 100)
    $layoutS = _GDIPlus_RectFCreate(970, 0, 100, 100)
    $layoutT = _GDIPlus_RectFCreate(1010, 0, 100, 100)
    $layoutU = _GDIPlus_RectFCreate(1040, 0, 100, 100)
    $layoutV = _GDIPlus_RectFCreate(1090, 0, 100, 100)
    $layoutW = _GDIPlus_RectFCreate(1150, 0, 100, 100)
    $layoutX = _GDIPlus_RectFCreate(1220, 0, 100, 100)
    $layoutY = _GDIPlus_RectFCreate(1270, 0, 100, 100)
    $layoutZ = _GDIPlus_RectFCreate(1315, 0, 100, 100)
    $graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(1366, 100, $graphic)
    $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($buffer, 2)
    _GDIPlus_GraphicsSetTextRenderingHint($buffer, 3)
    GUISetState()
    _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, "runter")
    _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, "rauf")
    _MouseSetOnEvent($MOUSE_WHEELDOWN_EVENT, "klick")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3
    ENDE()
    EndSwitch
    _BuchstabenMalen()
    _GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 1366, 100)
    WEnd
    Func runter()
    If $aktuellerBrush < 25 Then
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush += 1
    $brushes[$aktuellerBrush] = $brushBlau
    Else
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush = 0
    $brushes[$aktuellerBrush] = $brushBlau
    EndIf
    EndFunc ;==>runter
    Func rauf()
    If $aktuellerBrush > 1 Then
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush -= 1
    $brushes[$aktuellerBrush] = $brushBlau
    Else
    $brushes[$aktuellerBrush] = $brushSchwarz
    $aktuellerBrush = 25
    $brushes[$aktuellerBrush] = $brushBlau
    EndIf
    EndFunc ;==>rauf
    Func _BuchstabenMalen()
    _GDIPlus_GraphicsClear($buffer, 0xFFFFFFFF)
    _GDIPlus_GraphicsDrawStringEx($buffer, "A", $font, $layoutA, $format, $brushes[0])
    _GDIPlus_GraphicsDrawStringEx($buffer, "B", $font, $layoutB, $format, $brushes[1])
    _GDIPlus_GraphicsDrawStringEx($buffer, "C", $font, $layoutC, $format, $brushes[2])
    _GDIPlus_GraphicsDrawStringEx($buffer, "D", $font, $layoutD, $format, $brushes[3])
    _GDIPlus_GraphicsDrawStringEx($buffer, "E", $font, $layoutE, $format, $brushes[4])
    _GDIPlus_GraphicsDrawStringEx($buffer, "F", $font, $layoutF, $format, $brushes[5])
    _GDIPlus_GraphicsDrawStringEx($buffer, "G", $font, $layoutG, $format, $brushes[6])
    _GDIPlus_GraphicsDrawStringEx($buffer, "H", $font, $layoutH, $format, $brushes[7])
    _GDIPlus_GraphicsDrawStringEx($buffer, "I", $font, $layoutI, $format, $brushes[8])
    _GDIPlus_GraphicsDrawStringEx($buffer, "J", $font, $layoutJ, $format, $brushes[9])
    _GDIPlus_GraphicsDrawStringEx($buffer, "K", $font, $layoutK, $format, $brushes[10])
    _GDIPlus_GraphicsDrawStringEx($buffer, "L", $font, $layoutL, $format, $brushes[11])
    _GDIPlus_GraphicsDrawStringEx($buffer, "M", $font, $layoutM, $format, $brushes[12])
    _GDIPlus_GraphicsDrawStringEx($buffer, "N", $font, $layoutN, $format, $brushes[13])
    _GDIPlus_GraphicsDrawStringEx($buffer, "O", $font, $layoutO, $format, $brushes[14])
    _GDIPlus_GraphicsDrawStringEx($buffer, "P", $font, $layoutP, $format, $brushes[15])
    _GDIPlus_GraphicsDrawStringEx($buffer, "Q", $font, $layoutQ, $format, $brushes[16])
    _GDIPlus_GraphicsDrawStringEx($buffer, "R", $font, $layoutR, $format, $brushes[17])
    _GDIPlus_GraphicsDrawStringEx($buffer, "S", $font, $layoutS, $format, $brushes[18])
    _GDIPlus_GraphicsDrawStringEx($buffer, "T", $font, $layoutT, $format, $brushes[19])
    _GDIPlus_GraphicsDrawStringEx($buffer, "U", $font, $layoutU, $format, $brushes[20])
    _GDIPlus_GraphicsDrawStringEx($buffer, "V", $font, $layoutV, $format, $brushes[21])
    _GDIPlus_GraphicsDrawStringEx($buffer, "W", $font, $layoutW, $format, $brushes[22])
    _GDIPlus_GraphicsDrawStringEx($buffer, "X", $font, $layoutX, $format, $brushes[23])
    _GDIPlus_GraphicsDrawStringEx($buffer, "Y", $font, $layoutY, $format, $brushes[24])
    _GDIPlus_GraphicsDrawStringEx($buffer, "Z", $font, $layoutZ, $format, $brushes[25])
    EndFunc ;==>_BuchstabenMalen
    Func klick()
    Switch $aktuellerBrush
    Case 0
    Send("A")
    Case 1
    Send("B")
    Case 2
    Send("C")
    Case 3
    Send("D")
    Case 4
    Send("E")
    Case 5
    Send("F")
    Case 6
    Send("G")
    Case 7
    Send("H")
    Case 8
    Send("I")
    Case 9
    Send("J")
    Case 10
    Send("K")
    Case 11
    Send("L")
    Case 12
    Send("M")
    Case 13
    Send("N")
    Case 14
    Send("O")
    Case 15
    Send("P")
    Case 16
    Send("Q")
    Case 17
    Send("R")
    Case 18
    Send("S")
    Case 19
    Send("T")
    Case 20
    Send("U")
    Case 21
    Send("V")
    Case 22
    Send("W")
    Case 23
    Send("X")
    Case 24
    Send("Y")
    Case 25
    Send("Z")
    EndSwitch
    EndFunc ;==>klick

    [/autoit] [autoit][/autoit] [autoit]

    Func ENDE()
    _GDIPlus_BrushDispose($brushBlau)
    _GDIPlus_GraphicsDispose($buffer)
    _GDIPlus_GraphicsDispose($graphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>ENDE

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetTextRenderingHint
    ; Description ...: Seets the contrast value of a Graphics object
    ; Syntax.........: _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $iTextRenderingHint)
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $iTextRenderingHint - Text rendering mode:
    ; |0 - Character is drawn using the currently selected system font smoothing mode (also called a rendering hint)
    ; |1 - Character is drawn using its glyph bitmap and hinting to improve character appearance on stems and
    ; +curvature
    ; |2 - Character is drawn using its glyph bitmap and no hinting. This results in better performance at the
    ; +expense of quality
    ; |3 - Character is drawn using its antialiased glyph bitmap and hinting. This results in much better quality
    ; +due to antialiasing at a higher performance cost
    ; |4 - Character is drawn using its antialiased glyph bitmap and no hinting. Stem width differences may be
    ; +noticeable because hinting is turned off
    ; |5 - Character is drawn using its glyph Microsoft ClearType bitmap and hinting. This type of text rendering
    ; +cannot be used along with $CompositingModeSourceCopy
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: _GDIPlus_GraphicsGetTextRenderingHint
    ; Link ..........; @@MsdnLink@@ GdipSetTextRenderingHint
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $iTextRenderingHint)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "hwnd", $hGraphics, "int", $iTextRenderingHint)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetTextRenderingHint

    [/autoit]
  • Zitat

    Ich mag Century Gothic halt :D


    Dann lad die Font Datei entweder hier hoch oder gib uns wenigstens einen Link. Oder glaubst du jeder hat hier Lust erstmal nach dem Font zu Googlen, um das Script überhaupt zum funktionieren zu bringen?
    Du kannst es aber auch so machen, wie ich es in meinem uralten Spiel "Targets" gemacht habe.