Enter key vs Return key

  • Thread starter Thread starter zacks
  • Start date Start date
Z

zacks

Is there any way to distinguish the keypad Enter key from the standard
Return key?
 
I may be wrong but doesn't the Keycode in the KeyDown or KeyUp events
differentiate beween these keys?
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top