Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Const VK_CAPITAL = &H14
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Const VK_USED = VK_SCROLL
Private Type KeyboardBytes
kbByte(0 To 255) As Byte
End Type
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Long
Private Declare Function GetKeyboardState Lib "user32" (kbArray As KeyboardBytes) As Long
Private Declare Function SetKeyboardState Lib "user32" (kbArray As KeyboardBytes) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim kbArray As KeyboardBytes, CapsLock As Boolean, kbOld As KeyboardBytes
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Get the current keyboardstate
GetKeyboardState kbOld
'Hide the form
Me.Hide
MsgBox "Keep your eyes on the little num-, shift- and scrolllock lights on the keyboard."
TurnOff VK_CAPITAL
TurnOff VK_NUMLOCK
TurnOff VK_SCROLL
Sleep 1000
TurnOn VK_NUMLOCK
Sleep 100
TurnOn VK_CAPITAL
Sleep 100
TurnOn VK_SCROLL
Sleep 300
TurnOff VK_NUMLOCK
Sleep 100
TurnOff VK_CAPITAL
Sleep 100
TurnOff VK_SCROLL
Sleep 500
TurnOn VK_NUMLOCK
TurnOn VK_SCROLL
Sleep 200
TurnOff VK_NUMLOCK
TurnOff VK_SCROLL
Sleep 200
TurnOn VK_NUMLOCK
TurnOn VK_SCROLL
Sleep 200
TurnOff VK_NUMLOCK
TurnOff VK_SCROLL
Sleep 200
TurnOn VK_CAPITAL
Sleep 200
TurnOff VK_CAPITAL
Sleep 200
TurnOn VK_CAPITAL
Sleep 200
TurnOff VK_CAPITAL
Sleep 200
TurnOn VK_NUMLOCK
TurnOn VK_SCROLL
Sleep 200
TurnOff VK_NUMLOCK
TurnOff VK_SCROLL
Sleep 200
TurnOn VK_NUMLOCK
TurnOn VK_SCROLL
Sleep 200
TurnOff VK_NUMLOCK
TurnOff VK_SCROLL
Sleep 200
TurnOn VK_CAPITAL
Sleep 400
TurnOff VK_CAPITAL
Sleep 200
TurnOn VK_NUMLOCK
Sleep 100
TurnOn VK_CAPITAL
Sleep 100
TurnOn VK_SCROLL
Sleep 300
TurnOff VK_SCROLL
Sleep 100
TurnOff VK_CAPITAL
Sleep 100
TurnOff VK_NUMLOCK
Sleep 1000
Unload Me
End Sub
Private Sub TurnOn(vkKey As Long)
'Get the keyboard state
GetKeyboardState kbArray
'Change a key
kbArray.kbByte(vkKey) = 1
'Set the keyboard state
SetKeyboardState kbArray
End Sub
Private Sub TurnOff(vkKey As Long)
'Get the keyboard state
GetKeyboardState kbArray
'change a key
kbArray.kbByte(vkKey) = 0
'set the keyboard state
SetKeyboardState kbArray
End Sub
Private Sub Form_Unload(Cancel As Integer)
'restore the old keyboard state
SetKeyboardState kbOld
End Sub
Keycode: Key descriptor: HEX-Code: Description:
001 / 255 VK_LBUTTON (01) Left mouse button
002 / 256 VK_RBUTTON (02) Right mouse button
003 / 257 VK_CANCEL (03) Control-break processing
004 / 258 VK_MBUTTON (04) Middle mouse button (three-button mouse)
005 / 259 VK_XBUTTON1 (05) 2K/XP X1 mouse button
006 / 260 VK_XBUTTON2 (06) 2K/XP X2 mouse button
008 / 262 VK_BACK (08) BACKSPACE key
009 / 263 VK_TAB (09) TAB key
012 / 266 VK_CLEAR (0C) CLEAR key
013 / 267 VK_RETURN (0D) ENTER key
016 / 270 VK_SHIFT (10) SHIFT key
017 / 271 VK_CONTROL (11) CTRL key
018 / 272 VK_MENU (12) ALT key
019 / 273 VK_PAUSE (13) PAUSE key
020 / 274 VK_CAPITAL (14) CAPS LOCK key
021 / 275 VK_KANA (15) Input Method Editor (IME)
023 / 277 VK_JUNJA (17) IME Junja mode
024 / 278 VK_FINAL (18) IME final mode
025 / 279 VK_HANJA (19) IME Hanja mode
027 / 281 VK_ESCAPE (1B) ESC key
028 / 282 VK_CONVERT (1C) IME convert
029 / 283 VK_NONCONVERT (1D) IME nonconvert
030 / 284 VK_ACCEPT (1E) IME accept
031 / 285 VK_MODECHANGE (1F) IME mode change request
032 / 286 VK_SPACE (20) SPACEBAR
033 / 287 VK_PRIOR (21) PAGE UP key
034 / 288 VK_NEXT (22) PAGE DOWN key
035 / 289 VK_END (23) END key
036 / 290 VK_HOME (24) HOME key
037 / 291 VK_LEFT (25) LEFT ARROW key
038 / 292 VK_UP (26) UP ARROW key
039 / 293 VK_RIGHT (27) RIGHT ARROW key
040 / 294 VK_DOWN (28) DOWN ARROW key
041 / 295 VK_SELECT (29) SELECT key
042 / 296 VK_PRINT (2A) PRINT key
043 / 297 VK_EXECUTE (2B) EXECUTE key
044 / 298 VK_SNAPSHOT (2C) PRINT SCREEN key
045 / 299 VK_INSERT (2D) INS key
046 / 300 VK_DELETE (2E) DEL key
047 / 301 VK_HELP (2F) HELP key
048 / 302 (30) 0 key
049 / 303 (31) 1 key
050 / 304 (32) 2 key
051 / 305 (33) 3 key
052 / 306 (34) 4 key
053 / 307 (35) 5 key
054 / 308 (36) 6 key
055 / 309 (37) 7 key
056 / 310 (38) 8 key
057 / 311 (39) 9 key
065 / 319 (41) A key
066 / 320 (42) B key
067 / 321 (43) C key
068 / 322 (44) D key
069 / 323 (45) E key
070 / 324 (46) F key
071 / 325 (47) G key
072 / 326 (48) H key
073 / 327 (49) I key
074 / 328 (4A) J key
075 / 329 (4B) K key
076 / 330 (4C) L key
077 / 331 (4D) M key
078 / 332 (4E) N key
079 / 333 (4F) O key
080 / 334 (50) P key
081 / 335 (51) Q key
082 / 336 (52) R key
083 / 337 (53) S key
084 / 338 (54) T key
085 / 339 (55) U key
086 / 340 (56) V key
087 / 341 (57) W key
088 / 342 (58) X key
089 / 343 (59) Y key
090 / 344 (5A) Z key
091 / 345 VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
092 / 346 VK_RWIN (5C) Right Windows key (Natural keyboard)
093 / 347 VK_APPS (5D) Applications key (Natural keyboard)
095 / 349 VK_SLEEP (5F) Computer Sleep key
096 / 350 VK_NUMPAD0 (60) Numeric keypad 0 key
097 / 351 VK_NUMPAD1 (61) Numeric keypad 1 key
098 / 352 VK_NUMPAD2 (62) Numeric keypad 2 key
099 / 353 VK_NUMPAD3 (63) Numeric keypad 3 key
100 / 354 VK_NUMPAD4 (64) Numeric keypad 4 key
101 / 355 VK_NUMPAD5 (65) Numeric keypad 5 key
102 / 356 VK_NUMPAD6 (66) Numeric keypad 6 key
103 / 357 VK_NUMPAD7 (67) Numeric keypad 7 key
104 / 358 VK_NUMPAD8 (68) Numeric keypad 8 key
105 / 359 VK_NUMPAD9 (69) Numeric keypad 9 key
106 / 360 VK_MULTIPLY (6A) Multiply key
107 / 361 VK_ADD (6B) Add key
108 / 362 VK_SEPARATOR (6C) Separator key
109 / 363 VK_SUBTRACT (6D) Subtract key
110 / 364 VK_DECIMAL (6E) Decimal key
111 / 365 VK_DIVIDE (6F) Divide key
112 / 366 VK_F1 (70) F1 key
113 / 367 VK_F2 (71) F2 key
114 / 368 VK_F3 (72) F3 key
115 / 369 VK_F4 (73) F4 key
116 / 370 VK_F5 (74) F5 key
117 / 371 VK_F6 (75) F6 key
118 / 372 VK_F7 (76) F7 key
119 / 373 VK_F8 (77) F8 key
120 / 374 VK_F9 (78) F9 key
121 / 375 VK_F10 (79) F10 key
122 / 376 VK_F11 (7A) F11 key
123 / 377 VK_F12 (7B) F12 key
124 / 378 VK_F13 (7C) F13 key
125 / 379 VK_F14 (7D) F14 key
126 / 380 VK_F15 (7E) F15 key
127 / 381 VK_F16 (7F) F16 key
144 / 398 VK_NUMLOCK (90) NUM LOCK key
145 / 399 VK_SCROLL (91) SCROLL LOCK key
160 / 414 VK_LSHIFT (A0) Left SHIFT key
161 / 415 VK_RSHIFT (A1) Right SHIFT key
162 / 416 VK_LCONTROL (A2) Left CONTROL key
163 / 417 VK_RCONTROL (A3) Right CONTROL key
164 / 418 VK_LMENU (A4) Left MENU key
165 / 419 VK_RMENU (A5) Right MENU key
166 / 420 VK_BROWSER_BACK (A6) 2K/XP Browser Back key
167 / 421 VK_BROWSER_FORWARD (A7) 2K/XP Browser Forward key
168 / 422 VK_BROWSER_REFRESH (A8) 2K/XP Browser Refresh key
169 / 423 VK_BROWSER_STOP (A9) 2K/XP Browser Stop key
170 / 424 VK_BROWSER_SEARCH (AA) 2K/XP Browser Search key
171 / 425 VK_BROWSER_FAVORITES (AB) 2K/XP Browser Favorites key
172 / 426 VK_BROWSER_HOME (AC) 2K/XP Browser Start and Home key
173 / 427 VK_VOLUME_MUTE (AD) 2K/XP Volume Mute key
174 / 428 VK_VOLUME_DOWN (AE) 2K/XP Volume Down key
175 / 429 VK_VOLUME_UP (AF) 2K/XP Volume Up key
176 / 430 VK_MEDIA_NEXT_TRACK (B0) 2K/XP Next Track key
177 / 431 VK_MEDIA_PREV_TRACK (B1) 2K/XP Previous Track key
178 / 432 VK_MEDIA_STOP (B2) 2K/XP Stop Media key
179 / 433 VK_MEDIA_PLAY_PAUSE (B3) 2K/XP Play/Pause Media key
180 / 434 VK_LAUNCH_MAIL (B4) 2K/XP Start Mail key
181 / 435 VK_LAUNCH_MEDIA_SELECT (B5) 2K/XP Select Media key
182 / 436 VK_LAUNCH_APP1 (B6) 2K/XP Start Application 1 key
183 / 437 VK_LAUNCH_APP2 (B7) 2K/XP Start Application 2 key
187 / 441 VK_OEM_PLUS (BB) 2K/XP For any country/region, the '+' key
188 / 442 VK_OEM_COMMA (BC) 2K/XP For any country/region, the ',' key
189 / 443 VK_OEM_MINUS (BD) 2K/XP For any country/region, the '-' key
190 / 444 VK_OEM_PERIOD (BE) 2K/XP For any country/region, the '.' key