Solved

Caps Lock Status

Posted on 2006-11-02
6
511 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

724 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