True, I got sending keyboard input to semi work with some thing.
But I also just hooked and found where dinput8 had its keyboard buffer.
Then in game loop after it was filled with keys but before they were checked.
I would modify the state to set my own keys.
Did the proof in Cheat Engine + some OllyDBG back in the day then coded it into one of the last versions of Map Fun hah.
By the way, If anyone is interested in calling game functions for input and can't just use PostMessage/SendMessage due to Anti Hack hooks.
The game methods are going to be called in the WindowProcedure for click events.
Search in IDA for this, its probably passed to the create window call, or you can look for a constant such as 0x202 which is WM_LBUTTONUP.
#define WM_MOUSEFIRST 0x0200
#define WM_MOUSEMOVE 0x0200
#define WM_LBUTTONDOWN 0x0201
#define WM_LBUTTONUP 0x0202
#define WM_LBUTTONDBLCLK 0x0203
#define WM_RBUTTONDOWN 0x0204
#define WM_RBUTTONUP 0x0205
#define WM_RBUTTONDBLCLK 0x0206
#define WM_MBUTTONDOWN 0x0207
#define WM_MBUTTONUP 0x0208
#define WM_MBUTTONDBLCLK 0x0209
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
#define WM_MOUSEWHEEL 0x020A
#endif
Then look for calls after a if or switch case for your value.
Go into the call and see what its calling convention is.
Pressing Y in IDA or right click set function type. Will show you the type.
int __stdcall mouseLButtonUp(int, int)
Well lets assume those two ints are X and Y of the cursor.
And lets say relative to the window? (It might not be I have not bothered to look).
In this particular game it looks like there are many mouseLButtonUp sub functions which can be used in particular circumstances.
Probably different dialog windows or areas of the game eg at login, char select, creation etc..
Inventory?.
Once you have found a function you want to call, try to type def it.
This is as simple as looking at the type IDA says. (Or working it out your self if your capable to do that).
int __stdcall mouseLButtonUp(int x, int y)
Then specifying a type def equivalent so your code knows about this type.
typedef int (__stdcall *t_mouseLButtonUp)(int x, int y);
Now to call this as a function (Assuming you have an injected dll)
You could do this, where ADDRESS is the address of the method you found in hex.
t_mouseLButtonUp mouseLButtonUp = (t_mouseLButtonUp)0xADDRESS;
then call it like so.
mouseLButtonUp(x,y);
To call it from cheat engine script without writing a dll "Useful to test" you could do something like this.
[enable]
alloc(MyCode,1024)
CreateThread(MyCode)
MyCode:
push 0
push 0
call 0xADDRESS
ret // exit thread
[disable]
dealloc(mycode)
Or put the code someplace in a code cave, and use Ctrl+Alt+T to start a thread there

.