Page 1 of 1

Simulate keystrokes

Posted: Wed Dec 12, 2018 11:13 pm
by JohnFK
Is it possible in AA? To let the game think you pressed CTRL+A for example? Or CTRL+SHIFT+A?

Re: Simulate keystrokes

Posted: Sun Dec 16, 2018 8:02 am
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

Re: Simulate keystrokes

Posted: Mon Dec 17, 2018 1:57 pm
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)