|
-
May 1st, 2013, 10:41 AM
#1
Thread Starter
Lively Member
= and - key codes ? (GetASyncKeyState)
Hi !
I have a problem here
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.
-
May 1st, 2013, 10:55 AM
#2
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.
-
May 1st, 2013, 11:00 AM
#3
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.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 1st, 2013, 11:10 AM
#4
Re: = and - key codes ? (GetASyncKeyState)
 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 ;]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|