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. Key pressed time Logic

Key pressed time Logic

Scheduled Pinned Locked Moved C / C++ / MFC
game-devhelptutorial
5 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    manchukuo
    wrote on last edited by
    #1

    Hello i am currently facing this problem, i am doing a kind of game where when the user presses a key like the 'a' key it makes jump the object, but how to detect key press in a way to know how much jump, if you press the key for a tiny time do a little jump or if you got pressed the button too much jump only a maximum. Thanks

    D 1 Reply Last reply
    0
    • M manchukuo

      Hello i am currently facing this problem, i am doing a kind of game where when the user presses a key like the 'a' key it makes jump the object, but how to detect key press in a way to know how much jump, if you press the key for a tiny time do a little jump or if you got pressed the button too much jump only a maximum. Thanks

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

      Check out the WM_KEYUP and WM_KEYDOWN messages.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

      M 1 Reply Last reply
      0
      • D David Crow

        Check out the WM_KEYUP and WM_KEYDOWN messages.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

        M Offline
        M Offline
        manchukuo
        wrote on last edited by
        #3

        i know about this ones but how to get the time or do the logic for doing what i asked?

        D 1 Reply Last reply
        0
        • M manchukuo

          i know about this ones but how to get the time or do the logic for doing what i asked?

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

          Did you read the documentation, specifically about bits 0-15 of the LPARAM parameter?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

          M 1 Reply Last reply
          0
          • D David Crow

            Did you read the documentation, specifically about bits 0-15 of the LPARAM parameter?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            M Offline
            M Offline
            manchukuo
            wrote on last edited by
            #5

            Oh i see, i wasn't reading the MSDN documentation :p

            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