Auslessen Enter-Key

  • Thread starter Thread starter Stefan
  • Start date Start date
S

Stefan

Hallo NG

Gibt es eine Möglichkeit die Beiden Entertasten programmatisch zu
unterscheiden?
Enter Tasten / Enter NumBlock

Vielen Dank für eure Hilfe
Stefan
 
Hi Stefan,

This is an English newsgroup. The German newsgoups contain ".de." in the
name.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
oh sorry!
ok, now my problem in english:
is there a way the difference both enter-keys in code? one on the num-pad
and the other.
if yes: is it possible to change one enter-event to an other value?
 
I don´t think so using the KeyDown event (both are mapped to
KeyCode.Return), but it should be possible overriding ProcessKeyMessage in
the form, looking at some bits of the lparam (extended key flag or similar)
and calling to the base.ProcessKeyMessage:

WM_KEYDOWN Notification
http://msdn.microsoft.com/library/d...eference/keyboardinputmessages/wm_keydown.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Stefan said:
oh sorry!
ok, now my problem in english:
is there a way the difference both enter-keys in code? one on the num-pad
and the other.
if yes: is it possible to change one enter-event to an other value?

If what you want is to have both keys behave the same, it looks like the
Keys enumeration already does that for you; either button press will
return the value 13 (decimal); just override or attach a delegate to the
KeyDown event.

Carlos pointed out the ProcessKeyMessage method; override that and you
have access to the raw WM_KEYDOWN event data, where bit 24 shows if the
extended keys were touched: Message.LParam contains 0x11c0001 if it's
the keypad, and 0x1c0001 if it isn't.

The Forms.Message parameter is ByRef, you could probably change the
value of LParam there and just do a "Return MyBase.ProcessKeyMessage(m)"
to let the control do whatever it does after you've changed your data.

Macht mir nix aus wenn Du Deutsch hier reden willst. Es gibt doch ein
wenig hier, die Dich verstehen koennen, auch wenn wir keine Umlauttasten
auf der Tastatur besitzen. :-)

Rob, who had to look up the gender article for "Tastatur" and still
isn't sure he got it right...
 
Back
Top