lxn / win

A Windows API wrapper package for the Go Programming Language
Other
1.19k stars 312 forks source link

GetKeyState #82

Closed CraftedCat closed 5 years ago

CraftedCat commented 5 years ago
func keys() {
    for {
        time.Sleep(1 * time.Millisecond)
        for KEY := 0; KEY <= 256; KEY++ {
            Val, _, _ := procGetKeyState.Call(uintptr(KEY))
            if int(Val) == -32767 {
                switch KEY {
                               case 0x30:
                    tmp += "0"
                case 0x31:
                    tmp += "1"
                case 0x32:
                    tmp += "2"
                }
            }
        }
    }
}

how to catch keystrokes ? tmp empty. GetAsyncKeyState missing?