Advertisement
6_2008-2009 Miscellaneous #196795

Dedect keypress

This code finds if any key pressed. This will be helpfull for example you're programming a screensaver. But you can not get keypresses through forms because of some components which does not support this keypress event. So you must use some API's to do this.

AI

Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kaynak Kod
original-source
sKeyStat = 0
For i = 0 To 255
 KeyResult = GetAsyncKeyState(i)
  If KeyResult = -32767 Then
   sKeyStat = 1
   Exit For
  End If
Next i
 If sKeyStat = 1 Then
  msgbox "Key pressed!!!"
 End If
Upload
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı