Click here to Skip to main content
15,896,278 members
Home / Discussions / C#
   

C#

 
QuestionKeep from erasing working code in a project Pin
tonyonlinux18-Jan-10 18:11
tonyonlinux18-Jan-10 18:11 
AnswerMessage Closed Pin
18-Jan-10 18:46
stancrm18-Jan-10 18:46 
GeneralRe: Keep from erasing working code in a project Pin
tonyonlinux18-Jan-10 20:29
tonyonlinux18-Jan-10 20:29 
GeneralRe: Keep from erasing working code in a project Pin
Bekjong18-Jan-10 22:02
Bekjong18-Jan-10 22:02 
AnswerRe: Keep from erasing working code in a project Pin
Ashfield18-Jan-10 21:09
Ashfield18-Jan-10 21:09 
Questionexport .m file from text file in VS2008 Pin
mohamadali&M18-Jan-10 18:10
mohamadali&M18-Jan-10 18:10 
AnswerRe: export .m file from text file in VS2008 Pin
Ashfield18-Jan-10 21:13
Ashfield18-Jan-10 21:13 
QuestionKeyEventArgs - differentiate control chars on numeric keypad [modified] Pin
cdesmarais18-Jan-10 12:21
cdesmarais18-Jan-10 12:21 
Howdy,

I'm working with an widget that is getting key strokes as (System.Windows.Forms) KeyEventArgs. In particular I'm currently working on controlling input from the numeric keypad on that widget.
When this widget gets input from the numeric keypad, I want to ignore whether or not caps lock is on and always enter a number: pressing numeric keypad 4 should enter a number 4 whether or not num lock is on.

I don't think I can just ignore the num lock status (although I'm open to suggestions), so I'm trying to come up with a way to work with the KeyEventArgs. I'd like to determine how I can map the KeyEventArg that the widget gets and send a number instead.

The problem is:
I can't find anyway to differentiate the numeric key pad 4 with num lock off (that sends a '<-') from the actual '<-' key input.
I also can't tell the difference between the numeric key pad 7 with num lock off (that sends 'home') from the 'home' key input.

Its obvious how I could go the other way and tell the difference between the numeric keypad 4 with num lock on (sending a 4 or more specifically a Keys.Num4) and the '4' key (that would send Keys.D4).

Is it possible to differentiate between control characters sent from the numeric key pad and the normal control keys? Is there another way I might get the effect I'm looking for?

(Hope that's readable, that whole key pad 4 with num lock off is a bit wordy, so ask me to clarify it if you can't follow).

Thanks,

Chris

modified on Monday, January 18, 2010 6:30 PM

AnswerRe: KeyEventArgs - differentiate control chars on numeric keypad Pin
Luc Pattyn18-Jan-10 16:07
sitebuilderLuc Pattyn18-Jan-10 16:07 
Questionmanaged and unmanaged code............ Pin
3bood.ghzawi18-Jan-10 10:12
3bood.ghzawi18-Jan-10 10:12 
AnswerRe: managed and unmanaged code............ Pin
Not Active18-Jan-10 11:42
mentorNot Active18-Jan-10 11:42 
QuestionHow to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
GeniusMchlahla18-Jan-10 7:34
GeniusMchlahla18-Jan-10 7:34 
AnswerRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
J. Dunlap18-Jan-10 13:11
J. Dunlap18-Jan-10 13:11 
GeneralRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
GeniusMchlahla19-Jan-10 5:23
GeniusMchlahla19-Jan-10 5:23 
GeneralRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
J. Dunlap19-Jan-10 6:27
J. Dunlap19-Jan-10 6:27 
QuestionEditing crystal reports at runtime Pin
kruegs3518-Jan-10 7:03
kruegs3518-Jan-10 7:03 
QuestionMessage Removed Pin
18-Jan-10 6:19
professionalN_tro_P18-Jan-10 6:19 
AnswerRe: Application Info and Error logging Pin
Eddy Vluggen18-Jan-10 7:19
professionalEddy Vluggen18-Jan-10 7:19 
GeneralMessage Removed Pin
18-Jan-10 8:19
professionalN_tro_P18-Jan-10 8:19 
GeneralRe: Application Info and Error logging Pin
Eddy Vluggen18-Jan-10 10:33
professionalEddy Vluggen18-Jan-10 10:33 
AnswerRe: Application Info and Error logging Pin
Not Active18-Jan-10 7:26
mentorNot Active18-Jan-10 7:26 
AnswerRe: Application Info and Error logging Pin
Bardy8518-Jan-10 8:33
Bardy8518-Jan-10 8:33 
AnswerRe: Application Info and Error logging Pin
Keith Barrow18-Jan-10 23:30
professionalKeith Barrow18-Jan-10 23:30 
QuestionPhone dialer application with C# Pin
Drs201018-Jan-10 4:16
Drs201018-Jan-10 4:16 
AnswerRe: Phone dialer application with C# Pin
Covean18-Jan-10 5:36
Covean18-Jan-10 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.