Solved

Caps Lock Status

Posted on 2006-11-02
6
458 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
6 Comments
 
LVL 12

Accepted Solution

by:
UnexplainedWays earned 168 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 166 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 166 total points
ID: 17860234
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
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 look for a specific file type in a local or remote server directory using PHP.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now