Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to see if a key is pressed

how to see if a key is pressed

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yustme
    wrote on last edited by
    #1

    Hi, How can i make a console application listen to a pressed key? For example i want my application listen to ctrl+q keys. Anyone got a suggestion please? Thanks in advance!

    R 1 Reply Last reply
    0
    • Y Yustme

      Hi, How can i make a console application listen to a pressed key? For example i want my application listen to ctrl+q keys. Anyone got a suggestion please? Thanks in advance!

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Look into RegisterHotKey. I suggest you read on hooks and the SetWindowsHookEx function.


      Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

      Y S 2 Replies Last reply
      0
      • R Rajesh R Subramanian

        Look into RegisterHotKey. I suggest you read on hooks and the SetWindowsHookEx function.


        Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

        Y Offline
        Y Offline
        Yustme
        wrote on last edited by
        #3

        Hi, Thanks for your reply! I'll look in to them!

        1 Reply Last reply
        0
        • R Rajesh R Subramanian

          Look into RegisterHotKey. I suggest you read on hooks and the SetWindowsHookEx function.


          Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          I don't think SetWindowsHookEx will be of much help in a console a application.

          Steve

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups