+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 11 to 17 of 17

Thread: Check Caps Lock and Num Lock

  1. #11
    Newbie cismarel is an unknown quantity at this point
    Join Date
    May 2009
    Location
    Romania
    Age
    16
    Posts
    19

    Smile Re: Check Caps Lock and Num Lock

    But if i want check the caps and num lock in a windows form application?

  2. #12
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Re: Check Caps Lock and Num Lock

    So if thats the code.. it is possible to change the value?

    Code:
    Console.CapsLock = false;
    is this value a copy of the value or does it really change if caps lock is on?

  3. #13
    Banned arslan220 is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    63

    Re: Check Caps Lock and Num Lock

    hi thanks for sharing.

  4. #14
    Programming Professional Parabola will become famous soon enough Parabola will become famous soon enough Parabola's Avatar
    Join Date
    Jul 2009
    Location
    Texas
    Age
    25
    Posts
    300
    Blog Entries
    3

    Re: Check Caps Lock and Num Lock

    Quote Originally Posted by BlaineSch View Post
    So if thats the code.. it is possible to change the value?

    Code:
    Console.CapsLock = false;
    is this value a copy of the value or does it really change if caps lock is on?
    Quick Answer: Can't edit.
    Long Answer provided by the compiler itself:
    Property or indexer 'System.Console.CapsLock' cannot be assigned to -- it is read only

  5. #15
    Newbie rahuljin is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    3

    Re: Check Caps Lock and Num Lock

    Quote Originally Posted by cismarel View Post
    But if i want check the caps and num lock in a windows form application?
    i have the same question.

  6. #16
    Programming Professional Parabola will become famous soon enough Parabola will become famous soon enough Parabola's Avatar
    Join Date
    Jul 2009
    Location
    Texas
    Age
    25
    Posts
    300
    Blog Entries
    3

    Re: Check Caps Lock and Num Lock

    Quote Originally Posted by rahuljin View Post
    i have the same question.
    For those who want to use this in a windows form, Here's an example of how:

    Code:
    MessageBox.Show(Control.IsKeyLocked(Keys.CapsLock).ToString());
    Basically, Control.IsKeyLocked(Keys.Capslock) return a true or false.
    Correct syntax is such:
    Code:
    public static bool IsKeyLocked(
        Keys keyVal
    )
    keyVal being the key you want checked

    The way I used it:
    Code:
    Control.IsKeyLocked(Keys.<key>);
    Programmer (n): An organism that can turn caffeine into code.
    Programming would be so much easier without all the users.

  7. #17
    Learning Programmer gokuajmes is an unknown quantity at this point gokuajmes's Avatar
    Join Date
    Jan 2010
    Location
    India
    Age
    22
    Posts
    62

    Re: Check Caps Lock and Num Lock

    all are the same,but there are some coding strategies to use to minimize runtime,so i vote for both as they contain the qualities i consider
    You laugh at me because I'am different
    I laugh at you because you all are the same

+ Reply to Thread
Page 2 of 2
FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts