I could run a For..Next loop going through all the VK codes with GetASyncKeyState, but is there a simpler way to find out if ANY keys have been pressed?
I don't actually need to know what the keys are, you see, I just need to know if the user is typing.
How to detect ANY keyboard activity?
-
Seymour Clufley
- Addict

- Posts: 1266
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Code: Select all
OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
Repeat
Select WaitWindowEvent()
Case #WM_KEYDOWN, #WM_KEYUP
Debug "Type, type"
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
-
Seymour Clufley
- Addict

- Posts: 1266
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
-
hardfalcon
- User

- Posts: 89
- Joined: Fri Apr 29, 2005 3:03 pm
- Location: Luxembourg
- Contact:
Have a look at lowlevel keyboard hooks. There's some example code in the code archive, too...
"And God caused a deep sleep to fall upon Adam, and he slept: and he took one of his ribs, and closed up the flesh instead thereof; And the spare rib, which God had taken from man, made he a woman, and brought her unto the man"


