Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to simulate holding down a key

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
microsoftv
Advanced Cheater
Reputation: 0

Joined: 07 Apr 2016
Posts: 82
Location: U.S

PostPosted: Sun Oct 02, 2016 10:57 am    Post subject: How to simulate holding down a key Reply with quote

Like the title says. Also I haven't found anything when searching about it, and i'm somewhat new.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Sun Oct 02, 2016 11:13 am    Post subject: Re: How to simulate holding down a key Reply with quote

doKeyPress(key) -- simulates a key press

Exemple:
Code:

doKeyPress(VK_F) : simulates key F press
Back to top
View user's profile Send private message
microsoftv
Advanced Cheater
Reputation: 0

Joined: 07 Apr 2016
Posts: 82
Location: U.S

PostPosted: Sun Oct 02, 2016 12:05 pm    Post subject: Re: How to simulate holding down a key Reply with quote

Filipe_Br wrote:
doKeyPress(key) -- simulates a key press

Exemple:
Code:

doKeyPress(VK_F) : simulates key F press

Not a regular keypress, holding down a key, like if you hold down z = zzzzzzzzzzzzzzzzzzz.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Oct 02, 2016 3:09 pm    Post subject: Reply with quote

Code:
keyDown(VK_Z)
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Sun Oct 02, 2016 3:15 pm    Post subject: Re: How to simulate holding down a key Reply with quote

Code:

function _Key()
         keyDown(VK_Z) -- Pressed Key Z
end

t=createTimer()
timer_setInterval(t, 1) --1ms
timer_onTimer(t, _Key)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites