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. Caputuring all keystrokes

Caputuring all keystrokes

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 2 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.
  • S Offline
    S Offline
    SAK
    wrote on last edited by
    #1

    I am trying to have my app monitor the every key stroke. If F6 is press at any time, it should launch? Can anyone guide where I can find out how to do this? Thank you, SAK

    J 1 Reply Last reply
    0
    • S SAK

      I am trying to have my app monitor the every key stroke. If F6 is press at any time, it should launch? Can anyone guide where I can find out how to do this? Thank you, SAK

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      If you want your app to be activated when a key is pressed, take a look at the RegisterHotkey[^] function, and its message friend, WM_HOTKEY[^]. You can use the RegisterHotkey function to register a hotkey that, when pressed, sends your window a WM_HOTKEY message. You can then activate your app when you get it. BTW, F6 is not necessarily a good choice of hotkey, because another app is likely to already be using that key combination as a shortcut. Maybe you should use Ctrl+Shift+F6? ;)

      "Do unto others as you would have them do unto you." - Jesus
      "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

      S 1 Reply Last reply
      0
      • J J Dunlap

        If you want your app to be activated when a key is pressed, take a look at the RegisterHotkey[^] function, and its message friend, WM_HOTKEY[^]. You can use the RegisterHotkey function to register a hotkey that, when pressed, sends your window a WM_HOTKEY message. You can then activate your app when you get it. BTW, F6 is not necessarily a good choice of hotkey, because another app is likely to already be using that key combination as a shortcut. Maybe you should use Ctrl+Shift+F6? ;)

        "Do unto others as you would have them do unto you." - Jesus
        "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

        S Offline
        S Offline
        SAK
        wrote on last edited by
        #3

        Thank you so much for the help..most appreciated.

        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