Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determining if Numlock on or Off

Posted on 2001-06-25
6
Medium Priority
?
342 Views
Last Modified: 2012-05-04
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???
  Thanks!!!
   
0
Comment
Question by:sodakotahusker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
webwoman earned 75 total points
ID: 6225332
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?
0
 
LVL 1

Author Comment

by:sodakotahusker
ID: 6225657
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?????
     
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6225666
you want to tell which '.' key they pressed?

what if they only have one?

or three?
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 1

Author Comment

by:sodakotahusker
ID: 6225691
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.  
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6225880
oh well...

still...

I think it is a valid point.
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6225885
would you be so kind as to share a little knowledge too?

what are you doing?

data entry?

game?

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question