can't i get the caps lock status in js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    can't i get the caps lock status in js

    i want to trap the toggle key status in js

    plz help me...
    thanks in advance
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Also see this page for the explanation.

      Comment

      • coalnetpari
        New Member
        • Feb 2007
        • 7

        #4
        thanks for reply
        but i want to have the status whenever i want...
        can't i change the status whenever i want
        thanks in advance

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by coalnetpari
          thanks for reply
          but i want to have the status whenever i want...
          can't i change the status whenever i want
          thanks in advance
          You can't change the status (security reasons). It's possible using ActiveX but that will only work in IE.

          Comment

          • dmjpro
            Top Contributor
            • Jan 2007
            • 2476

            #6
            can u refer to any site where i can get sample code or send me some sample code by which i can try it out

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Try
              Code:
              Set WSHShell = WScript.CreateObject("WScript.Shell") 
              WSHShell.SendKeys "{CAPSLOCK}"
              Not sure if you can use this within VBScript, but worth a try.

              Comment

              • dmjpro
                Top Contributor
                • Jan 2007
                • 2476

                #8
                thanx for ur reply ...

                i think i better to leave the idea
                isn't it............. ....

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Yes, definitely. I don't agree with messing with people's keyboards, etc. It confuses the user and opens a whole can of worms.

                  I can agree with read-only access (just find out the status) which you can do using the link to the script I gave earlier (though it's not direct, it uses a method to determine that). It can prove useful when entering passwords - you can inform the user that they may have left the caps lock key on by accident.

                  Comment

                  Working...