View previous topic :: View next topic |
Author |
Message |
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Wed Oct 27, 2021 5:32 am Post subject: Check if key pressed once |
|
|
I wanted to make this,but idk how to
Like in c++ and c i can use
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Wed Oct 27, 2021 6:38 am Post subject: |
|
|
This should work as intended.
Code: |
isKeyPressed(key) : returns true if the specified key is currently pressed
|
|
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Wed Oct 27, 2021 6:42 am Post subject: |
|
|
LeFiXER wrote: | This should work as intended.
Code: |
isKeyPressed(key) : returns true if the specified key is currently pressed
|
|
i'm using timer,while and repeat are freezing cheat engine
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Wed Oct 27, 2021 7:19 am Post subject: |
|
|
If you had while/repeat in another thread that have specific criteria to ensure an infinite loop isn't going to happen then you should be okay to use that. Note that other threads can't access the GUI.
If you're using a timer instead, set a flag once the key is pressed and have the timer check the condition of the flag.
|
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Wed Oct 27, 2021 8:14 am Post subject: |
|
|
tried but failing
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
Flux. Advanced Cheater Reputation: 0
Joined: 10 Nov 2016 Posts: 84 Location: Another World - N5X2 106311411+2123518
|
Posted: Sat Oct 30, 2021 2:16 pm Post subject: |
|
|
Hello Frouk,
I wanted to have a go at this.
This is what i came up with, everytime z is pressed you should hear a beep!
Code: | {$lua}
[ENABLE]
timer = createTimer(nil)
timer.setInterval = 1000
timer.OnTimer = function()
isk = isKeyPressed(VK_Z)
if isk == true then beep()
end
end
[DISABLE]
timer.destroy()
timer=nil |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Sat Oct 30, 2021 5:00 pm Post subject: |
|
|
createHotkey for that one key may work as it also responses to the 'pressed since last check'
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Flux. Advanced Cheater Reputation: 0
Joined: 10 Nov 2016 Posts: 84 Location: Another World - N5X2 106311411+2123518
|
Posted: Sun Oct 31, 2021 3:32 am Post subject: |
|
|
Here is a quick key test using a hotkey, which beeps when pressing z. Code: | {$lua}
[ENABLE]
HK = createHotkey(beep,VK_Z)
[DISABLE]
if HK then HK.Destroy(); HK=nil end |
|
|
Back to top |
|
|
|