AllenDang/w32 — pull request #26 by brunoqc (2013-09-10 05:18:12+00:00)
Title: Added SendInput()

If you mind the :

// #include
import "C"

the `(*MouseInput)(unsafe.Pointer(&input)).mi = oneInput.Mi` trick could be done by the user but with this commit the user can use SendInput easily with :

package main

import "github.com/AllenDang/w32"

func main() {
var pInputs []w32.INPUT
pInputs = append(pInputs, w32.INPUT{Type: w32.INPUT_KEYBOARD, Ki: w32.KEYBDINPUT{WVk: 0x56}})
pInputs = append(pInputs, w32.INPUT{Type: w32.INPUT_KEYBOARD, Ki: w32.KEYBDINPUT{WVk: 0x57}})
pInputs = append(pInputs, w32.INPUT{Type: w32.INPUT_MOUSE, Mi: w32.MOUSEINPUT{Dx: 5, Dy: 5, DwFlags: w32.MOUSEEVENTF_MOVE}})

w32.SendInput(pInputs)
}