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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Which Message to handle for Only ALT key

Which Message to handle for Only ALT key

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 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.
  • V Offline
    V Offline
    Vikash Dubey 0
    wrote on last edited by
    #1

    How can I detect when the ALT key is pressed and no other key is pressed? I wanted to change my cursor when the ALT is pressed. So i wanted to know which message is sent in this case. Thanks

    N 1 Reply Last reply
    0
    • V Vikash Dubey 0

      How can I detect when the ALT key is pressed and no other key is pressed? I wanted to change my cursor when the ALT is pressed. So i wanted to know which message is sent in this case. Thanks

      N Offline
      N Offline
      Nilesh K
      wrote on last edited by
      #2

      Try with WM_SYSKEYDOWN

      - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

      V 1 Reply Last reply
      0
      • N Nilesh K

        Try with WM_SYSKEYDOWN

        - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

        V Offline
        V Offline
        Vikash Dubey 0
        wrote on last edited by
        #3

        It works only if i press a key followed by ALT. I want an event which fires when i press just the ALT key .

        D N 3 Replies Last reply
        0
        • V Vikash Dubey 0

          It works only if i press a key followed by ALT. I want an event which fires when i press just the ALT key .

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Is GetAsyncKeyState() of any help?


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          V 1 Reply Last reply
          0
          • D David Crow

            Is GetAsyncKeyState() of any help?


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            V Offline
            V Offline
            Vikash Dubey 0
            wrote on last edited by
            #5

            Yes i am using it get the state of the ALT key but the point is I want to change my cursor as soon as the user presses the ALT key so for that i would require an event being fired or Currently i am using a timer which uses GetAsyncKeyState() to get the state and then i change the app cursor. Thanks

            1 Reply Last reply
            0
            • V Vikash Dubey 0

              It works only if i press a key followed by ALT. I want an event which fires when i press just the ALT key .

              N Offline
              N Offline
              Nilesh K
              wrote on last edited by
              #6

              Vikash Dubey wrote: It works only if i press a key followed by ALT. Could you show me how and where you have written the code.

              - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

              1 Reply Last reply
              0
              • V Vikash Dubey 0

                It works only if i press a key followed by ALT. I want an event which fires when i press just the ALT key .

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                What about the WM_CHAR message?


                "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                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