Thread: toggle caps lock on or off

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    63

    toggle caps lock on or off

    How would I go about turning caps lock on or off in a dos program?

    Please help.
    tudehopet uses Borland Compiler 5.5
    and Visual C++ 6.

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Lightbulb Like this, maybe...

    First be sure you #include <windows.h>, then do this:

    SendMessage(NULL, WM_KEYDOWN, (WPARAM) VK_CAPITAL, (LPARAM) 0);
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    29
    I have seen some nice one-line functions for toggling Caps Lock on/off, maybe here: http://www.cprogramming.com/source/caps.zip

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    63
    Thanks for the help guys.
    tudehopet uses Borland Compiler 5.5
    and Visual C++ 6.

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    249

    Try this

    I hope you try this one...
    Code:
    *(char far *)1047 |= 64;
    I have this in my notes.
    That will get it on.... i think so.
    C++
    The best

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Atomic Operations
    By Elysia in forum Windows Programming
    Replies: 27
    Last Post: 03-27-2008, 02:38 AM
  2. CAPS LOCK key detect
    By thebrighter in forum Windows Programming
    Replies: 3
    Last Post: 07-20-2007, 09:51 AM
  3. getting caps, num, and scroll lock state
    By lambs4 in forum Windows Programming
    Replies: 1
    Last Post: 11-10-2002, 06:50 PM
  4. How do you toggle keys like Scroll lock without Windows API?
    By animeaholic in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2002, 07:02 PM
  5. Caps lock with Windows programming
    By Garfield in forum Windows Programming
    Replies: 1
    Last Post: 12-28-2001, 04:41 PM