Determining if Numlock on or Off

I'm doing keypress validations.  I have found how to check for Shiftkey, alt key and ctrl key being pressed but now I need to allow users to use the numerical keypad.  I have to know if the numlock is on or off when a key comes through.  Can anyone tell me how to determinate that with javascript???
Who is Participating?
I doubt you can. It's not a keypress, not if it's already on.

However, does it matter? If they're using the numeric keypad, and they DON'T have numlock on, they won't input a number. If you're checking for numbers, do you care where they came from?
sodakotahuskerAuthor Commented:
Yes I care if I only have the numeric representation of the keystroke.  If the user presses the decimal point on the keyboard it fires code 46.  If they press the decimal point on the numeric keypad it fires 190 if they have numlock on.  If they don't - it fires 46.  How do I tell the difference between 46 and 46?????
you want to tell which '.' key they pressed?

what if they only have one?

or three?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sodakotahuskerAuthor Commented:
Oops.  The decimal point on the keyboard returns 190.  With numlock returns 110.   Without numlock returns 46.  
No issue here.  Sorry for the false alarm.  
    Thanks for forcing me to recheck my original findings.  
oh well...


I think it is a valid point.
would you be so kind as to share a little knowledge too?

what are you doing?

data entry?


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.