Jump to content

How to dedect activity?


E1M1
 Share

Recommended Posts

unfortunately all i can think of is going through all possible key combos and combining them with the "Or" operator, this way any key press would register.

This method is messy, but it would work. You could probably do it in steps or build a seperate function like keyIsPressed() that returns a boolean value.

I wonder if anyone else has a simpler option... ;)

Edited by Drifter
Link to comment
Share on other sites

Here's somethig I've been fiddling with lately. You may find it useful. Keep in mind that I'm new to using DLLs and whatnot.

Link to the MSDN article: GetKeyboardState

Global Const $byteArray = DllStructCreate("BYTE lpKeyState[256]")
Global Const $lpKeyState = DllStructGetPtr($byteArray)

DllCall("User32.dll", "bool", "GetKeyboardState", "ptr", $lpKeyState)

Global Const $KeyboardState = DllStructGetData($byteArray, "lpKeyState")

Global $j = 1

For $i = 3 To StringLen($KeyboardState) Step 4
    ConsoleWrite($j & " " & StringMid($KeyboardState, $i, 4) & @LF)
    $j += 1
Next
Edited by jaberwocky6669
Link to comment
Share on other sites

unfortunately all i can think of is going through all possible key combos and combining them with the "Or" operator, this way any key press would register.

This method is messy, but it would work. You could probably do it in steps or build a seperate function like keyIsPressed() that returns a boolean value.

I wonder if anyone else has a simpler option... ;)

this has been addressed before... search for "any key pressed" i think will find it
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...