A friend of mine is blind and I\'ve got an idea of developing a program that would let him use a PC with the help of a blind typing method and audial feedback. The experienc
I know this topic is old, but I found a possible solution. You can use the last answer and edit it a little bit:
Instead of calling the next hook:
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
{
int vkCode = Marshal.ReadInt32(lParam);
Console.WriteLine((Keys)vkCode);
}
return CallNextHookEx(_hookID, nCode, wParam, lParam);
}
just return -1 for stopping preceding any handle to other controls:
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
{
int vkCode = Marshal.ReadInt32(lParam);
Console.WriteLine((Keys)vkCode);
}
return -1;
}
This isn't nice but it's working. Be careful with this!