|
-
Apr 30th, 2002, 12:30 PM
#1
virtual key
Hi,
Does somebody know how to capture the Enter key?
In my Visual c++ 5.0 program, i use the WM_KEYDOWN to capture the key press, I can capture most of the keys, like F1,F2,A,B,C....but Enter and Esc and a few others I can not. help please.
thanks
-
Apr 30th, 2002, 01:03 PM
#2
Fanatic Member
esc = Ascii code 27.
enter/return = Ascii code 13.
Digital-X-Treme
Contact me on MSN Messenger: [email protected]
[VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
/ (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]
-
Apr 30th, 2002, 01:06 PM
#3
my problem is...
yes, I know the key value. My problem is that when I hit the Enter or Esc key, the program does not go to the WM_KEYDOWN function.
-
Apr 30th, 2002, 02:18 PM
#4
Monday Morning Lunatic
That's because they're already captured for things like the default button. Are you using a dialogue rather than a raw window?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 30th, 2002, 02:30 PM
#5
Yes
Yes, I am using CBitmapDialog, which is based on CDialog.
I do not have any butttons on it, just some static lables. If the Enter and Esc are captured by default, where? and how can I change the default setting? Thanks.
-
May 1st, 2002, 02:19 PM
#6
In MFC you can probably override the PreTranslateMessage function. In WinAPI I believe it to be impossible with normal dialogs (it may be impossible with the common dialogs in MFC too).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 1st, 2002, 02:28 PM
#7
thanks for the help
yes, you are right. I do need override the PreTranslateMessage function. It works OK now.
Thanks again,guys.
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
|