I am wanting to create a simple application that when running would wait for a specific key or combination of keys OR even button presses on a mouse. I am using the MouseKeyHook API in order to get this information, however I am running into a few issues.
This seems to work perfectly, as I can compare the string values of the Buttons with what I have saved. Now here is where the real issue begins. Whenever I press any programmable button on my keyboard I dont get ANY output? Why?
private void GlobalHookKeyPress(object sender, KeyPressEventArgs e)
{
HotKey.Text = e.KeyChar.ToString();
}
private void GlobalHookMouseDownExt(object sender, MouseEventExtArgs e)
{
HotKey.Text = e.Button.ToString();
}
When Hooking using the MouseKeyHook API, I was able to get the two mouse buttons XButton1 and XButton2 but I got nothing for my keyboard buttons.