Thread: Detect pressed keys

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Detect pressed keys

    Hello!
    How can I check what keys are in "key down" state?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Use some OS/compiler specific library.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Grey Wizard C_Sparky's Avatar
    Join Date
    Sep 2009
    Posts
    50
    For Windows:

    Set a windows hook with SetWindowsHookEx() (keyboard hook)

    then use a callback procedure to process the keys being pressed

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    I swear there was a Search button... yep, still there. Wasn't this asked just yesterday, and the day before, and the day before that, etc, for(;;);... ?

    Detect pressed keys c - Google Search

  6. #6
    The Autodidact Dante Wingates's Avatar
    Join Date
    Apr 2010
    Location
    Valhalla
    Posts
    56
    jump twice, turn 360° then close your eyes and say, "oh mighty computer, how do I know when a key has been pressed?"

    Then the mighty computer will give you these links: hooking and SetWindowsHookEx

    Then last but not least, you read...
    2B OR !2B? That is the question!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simulate Keys with a Keyboard Hook
    By guitarist809 in forum Windows Programming
    Replies: 3
    Last Post: 11-14-2008, 08:14 PM
  2. Pressed keys problem
    By Snip in forum Game Programming
    Replies: 2
    Last Post: 08-31-2005, 07:41 AM
  3. how to detect multimedia keys
    By kwazar in forum Windows Programming
    Replies: 1
    Last Post: 01-25-2003, 05:32 PM
  4. Array of possible keys that can be pressed
    By PHP in forum C++ Programming
    Replies: 2
    Last Post: 12-18-2002, 10:02 PM
  5. How to detect special keys using c++
    By sundeeptuteja in forum C++ Programming
    Replies: 1
    Last Post: 07-04-2002, 05:45 PM