Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Caps Lock Status

Posted on 2006-11-02
6
Medium Priority
?
528 Views
Last Modified: 2012-05-05
hi experts,

I m doing my asp.net project using javascript.  I have one login page. Now i what i want is, When the caps lock key is on that time the tooltip should get display. Question is how to trace whether the Caps Lock is on or off? Is there any way in javascript to trace this?

Plz Help. It's urgent.

thanx
0
Comment
Question by:s_monani
4 Comments
 
LVL 12

Accepted Solution

by:
UnexplainedWays earned 672 total points
ID: 17857427
As far as i know there is no way to via javascript to find if the cap's lock is on, the only way i can think is to check when you get input if it's an upper or lower case.

So when something get's entered, check the data and get the ascii value of it.  If the letter is between a certain range then you can tell if it's upper or lower case, and if all the letters are upper they either have the shift key down or the cap's lock.

http://www.lookuptables.com for the numbers.
0
 
LVL 1

Assisted Solution

by:jsimbeck
jsimbeck earned 664 total points
ID: 17857949
I've not tried this, but it may be worth a shot.  
(not my own work, I found it at:  http://www.rgagnon.com/pbdetails/pb-0236.html


[local function declaration]
FUNCTION  int GetKeyState(int keystatus) LIBRARY "user32.dll"

[powerscript]
int li_keystate

li_keystate = GetKeyState(20)

IF li_keystate = 1 THEN
    MessageBox("", "CAPS on")
ELSEIF li_keystate = 0 THEN
    MessageBox("", "CAPS off")
END IF
0
 
LVL 6

Expert Comment

by:davbouchard
ID: 17860179
jsimbeck, that is not javascript and cannot be used for web development.

I will try to find something but, I would go with UnexplainedWays`s solution.
0
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 664 total points
ID: 17860234
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month20 days, 20 hours left to enroll

810 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