Simulate keystrokes

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
JohnFK
Cheater
Cheater
Posts: 38
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 9

Simulate keystrokes

Post by JohnFK » Wed Dec 12, 2018 11:13 pm

Is it possible in AA? To let the game think you pressed CTRL+A for example? Or CTRL+SHIFT+A?

Eric
Hall of Famer
Hall of Famer
Posts: 94
Joined: Thu Mar 02, 2017 11:01 pm
Reputation: 34

Re: Simulate keystrokes

Post by Eric » Sun Dec 16, 2018 8:02 am

In Lua yes, in AA a bit more troublesome. You'll have to call keybd_event with the proper parameters , or invoke ce's lua engine from inside the target game

JohnFK
Cheater
Cheater
Posts: 38
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 9

Re: Simulate keystrokes

Post by JohnFK » Mon Dec 17, 2018 1:57 pm

Calling keybd_event in AA works. But only the first key. All others keys were ignored. Can you tell me why? Example below should press return key twice. I believe for pressing more than one key there has to be a kind of delay between the key presses, just having no idea how I can simulate a sleep in AA then.

Code: Select all

[ENABLE]
alloc(test,2048)
test:
sub rsp,28
mov rcx, D
mov rdx, 0
mov r8, 0
mov r9, 0
call keybd_event
add rsp,28

sub rsp,28
mov rcx, D
mov rdx, 0
mov r8, 2
mov r9, 0
call keybd_event
add rsp,28

sub rsp,28
mov rcx, D
mov rdx, 0
mov r8, 0
mov r9, 0
call keybd_event
add rsp,28

sub rsp,28
mov rcx, D
mov rdx, 0
mov r8, 2
mov r9, 0
call keybd_event
add rsp,28

ret

createthread(test)

[DISABLE]
dealloc(test)

Post Reply

Who is online

Users browsing this forum: No registered users