I'm trying to use VkKeyScan from the Window's API, however the program crashes whenever that function is called. I've had no problems with other Window's API functions I've imported and used in this way. Is there something wrong with my syscall.Syscall call?
var (
user32, _ = syscall.LoadLibrary("user32.dll")
vkKeyScan, _ = syscall.GetProcAddress(user32, "VkKeyScan")
)
func VkKeyScan(char byte) (int16, syscall.Errno) {
var nargs uintptr = 1
ret, _, callErr := syscall.Syscall(uintptr(vkKeyScan), nargs, uintptr(char), 0, 0)
return int16(ret), callErr
}