Home All Groups Group Topic Archive Search About

Enter key vs Return key

Author
16 Jan 2006 3:25 PM
zacks
Is there any way to distinguish the keypad Enter key from the standard
Return key?

Author
16 Jan 2006 3:34 PM
Carlos J. Quintero [VB MVP]
I think that this was asked some weeks ago (try to search Google) and I
think that not using .NET but maybe using the subclassing to trap the
WM_KEYDOWN message and getting the info from the wparam or lparam. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputmessages/wm_keydown.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com


<za***@construction-imaging.com> escribió en el mensaje
Show quoteHide quote
news:1137425144.230393.108900@o13g2000cwo.googlegroups.com...
> Is there any way to distinguish the keypad Enter key from the standard
> Return key?
>
Author
17 Jan 2006 12:25 AM
Dennis
I may be wrong but doesn't the Keycode in the KeyDown or KeyUp events
differentiate beween these keys?
--
Dennis in Houston


Show quoteHide quote
"Carlos J. Quintero [VB MVP]" wrote:

> I think that this was asked some weeks ago (try to search Google) and I
> think that not using .NET but maybe using the subclassing to trap the
> WM_KEYDOWN message and getting the info from the wparam or lparam. See:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputmessages/wm_keydown.asp
>
> --
>
> Best regards,
>
> Carlos J. Quintero
>
> MZ-Tools: Productivity add-ins for Visual Studio
> You can code, design and document much faster:
> http://www.mztools.com
>
>
> <za***@construction-imaging.com> escribió en el mensaje
> news:1137425144.230393.108900@o13g2000cwo.googlegroups.com...
> > Is there any way to distinguish the keypad Enter key from the standard
> > Return key?
> >
>
>
>
Author
17 Jan 2006 12:02 PM
Carlos J. Quintero [VB MVP]
Hi Dennis,

The KeyCode is Return (13) in both cases, which makes sense, since your app
normally is not interested in the physical key that was pressed.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com


Show quoteHide quote
"Dennis" <Den***@discussions.microsoft.com> escribió en el mensaje
news:34A6B933-298D-41FF-80D7-FE7EDFE2CA85@microsoft.com...
>I may be wrong but doesn't the Keycode in the KeyDown or KeyUp events
> differentiate beween these keys?
> --
> Dennis in Houston
>
>
Author
17 Jan 2006 1:31 AM
Armin Zingler
<za***@construction-imaging.com> schrieb
> Is there any way to distinguish the keypad Enter key from the standard
> Return key?

   Private IsExtendedKey As Boolean

   Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

      Const WM_KEYDOWN As Integer = &H100
      Const WM_KEYUP As Integer = &H101

      If m.Msg = WM_KEYDOWN OrElse m.Msg = WM_KEYUP Then
         IsExtendedKey = (m.LParam.ToInt32 And &H1000000) <> 0
      End If

      MyBase.WndProc(m)

   End Sub


In KeyDown/KeyUp, you can check IsExtendedKey now.


Armin