Simulate keystrokes

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

Simulate keystrokes

Post by JohnFK »

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: 174
Joined: Thu Mar 02, 2017 11:01 pm
Reputation: 90

Re: Simulate keystrokes

Post by Eric »

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
Expert Cheater
Expert Cheater
Posts: 59
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 27

Re: Simulate keystrokes

Post by JohnFK »

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