User Input - Keyboard

This is a discussion on User Input - Keyboard within the Windows Programming forums, part of the Platform Specific Boards category; How can i know the user input trough the keyboard when my program isnīt in the focus? e.g.: Iīm at ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220

    User Input - Keyboard

    How can i know the user input trough the keyboard when my program isnīt in the focus?
    e.g.: Iīm at my desktop and when I press alt+x my program comes to the screen, something like that, or just handle the input trough WM_CHAR.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Sounds like you want a hot key. Look up the RegisterHotKey function.

  3. #3
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    I was just using RegisterHotKey for my app, but had no idea it registered the hotkey system-wide! How do you register a hotkey exclusively for use only when your window has keyboard focus?
    (I was thinking of handling WM_CHAR, but I don't know if/how a WM_CHAR message will notify you of any modifier keys being pressed like the WM_HOTKEY message does...)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. timed user input
    By sainiabhishek in forum C Programming
    Replies: 4
    Last Post: 04-01-2009, 12:59 PM
  2. Truncating user input
    By CS_Student8337 in forum C Programming
    Replies: 10
    Last Post: 03-19-2009, 01:34 AM
  3. Trouble with error checking on input from user.
    By NuNn in forum C Programming
    Replies: 8
    Last Post: 01-23-2009, 12:59 PM
  4. Replies: 4
    Last Post: 04-03-2008, 10:07 PM
  5. Replies: 4
    Last Post: 04-21-2004, 05:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21