-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendInput INPUT struct missing? #7
Comments
Here's what I translated: // type INPUT struct {
// DWORD type;
// _ANONYMOUS_UNION union {
// MOUSEINPUT mi;
// KEYBDINPUT ki;
// HARDWAREINPUT hi;
// } DUMMYUNIONNAME;
// } INPUT,*PINPUT,*LPINPUT;
type INPUT struct {
Type uint32
AnonUnion interface{}
}
// typedef struct tagMOUSEINPUT {
// LONG dx;
// LONG dy;
// DWORD mouseData;
// DWORD dwFlags;
// DWORD time;
// ULONG_PTR dwExtraInfo;
// } MOUSEINPUT, *PMOUSEINPUT;
type MOUSEINPUT struct {
Dx int32
Dy int32
MouseData uint32
DwFlags uint32
Time uint32
DwExtraInfo uintptr // int?
}
// typedef struct tagKEYBDINPUT {
// WORD wVk;
// WORD wScan;
// DWORD dwFlags;
// DWORD time;
// ULONG_PTR dwExtraInfo;
// } KEYBDINPUT, *PKEYBDINPUT;
type KEYBDINPUT struct {
WVk int16
WScan int16
DwFlags uint32
Time uint32
DwExtraInfo uintptr // int?
}
// typedef struct tagHARDWAREINPUT {
// DWORD uMsg;
// WORD wParamL;
// WORD wParamH;
// } HARDWAREINPUT, *PHARDWAREINPUT;
type HARDWAREINPUT struct {
UMsg uint32
WParamL int16
WParamH int16
} |
It's already there: https://github.com/lxn/win/blob/master/user32.go#L1376 |
Oh god, I searched but GitHub said 0 results 👎 Thanks Alex! |
No problemo :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there Alexander,
I'm trying to simulate keystrokes but unfortunately
win
lacks the INPUT struct required.Is there any "easy" way to port it from the C headers to Go?
There's this other package which uses cgo to deal with it but in the project I'm working on I can't use cgo 👎...
https://github.com/AllenDang/w32/blob/e6b20c288197ddc4eac94ede4f67965a604a7bf4/user32.go#L922
Thanks!
The text was updated successfully, but these errors were encountered: