= and - key codes ? (GetASyncKeyState)
Hi !
I have a problem here :D
I am making a program with hotkeys, and i need to use those two keys: = and - (those two near Backspace, not on numeric keyboard)
Those two keys are used as + and -, but i kinda cant find out its key code.When i capture it in KeyPress event, it just shows "=" and "-" not the actual Keys.Key value
At start i thought its Add and Subtract, but those are those keys on numeric keyboard, and not everyone has it.
Thanks in advance.
Re: = and - key codes ? (GetASyncKeyState)
Well, I cannot find one here, but I can find on ein the ASCII table here. You can also use the CChar("=") or CChar("-")
Code:
If e.KeyChar = CChar("=") Then
MessageBox.Show("=")
ElseIf e.KeyChar = CChar("-") Then
MessageBox.Show("-")
End If
Not only will that work with the subtract button next to the backspace, but it works on the numeric keypad as well.
Re: = and - key codes ? (GetASyncKeyState)
You should use KeyDown for hotkeys not KeyPress. Many keys do not trigger a keypress event at all. The two keys are KeyCode.Oemplus and KeyCode.OemMinus.
Re: = and - key codes ? (GetASyncKeyState)
Quote:
Originally Posted by
dunfiddlin
You should use KeyDown for hotkeys not KeyPress. Many keys do not trigger a keypress event at all. The two keys are KeyCode.Oemplus and KeyCode.OemMinus.
Ahh, those are the key codes! Oh course you'd know them ;]