RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Holding down a Key?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
Hello

How do I make it so that you got to hold down a key to do a certain action?
Like hold the SHIFT key, then press UP to look up, or press RIGHT to look right.

Help please.
Thanks!
==-+-==ACTIVE PROJECT==-+-==
          Kingdom of Warfare I

*
Rep: +0/-0Level 84
Don't know if this works, but have the SHIFT key set a variable to 7, then run a loop and use conditional branches to constantly check if that variable is 7. Then, within the branch, have more key inputs for up, down, whatever.


**
Rep:
Level 86
Don't know if this works, but have the SHIFT key set a variable to 7, then run a loop and use conditional branches to constantly check if that variable is 7. Then, within the branch, have more key inputs for up, down, whatever.



Sorry, tried that.

Thanks for replying though! XD
==-+-==ACTIVE PROJECT==-+-==
          Kingdom of Warfare I

*
Rep:
Level 85
Real Men Make Fan Games
Project of the Month winner for May 2009
You'll have to tweak this to meet your needs, but this is the gist of it.

Code: [Select]
:Loop
     :Variable Operation: Set [BUTTON PRESS] to 0
     :Wait 0.1 Seconds
     :Key Input to [BUTTON PRESS]
     :Branch if Var [BUTTON PRESS] is 1 or more
          :Branch if Switch [PAUSE] is OFF
               :Switch Operation [PAUSE] ON
               :Variable Operation: Set [BUTTON PRESS] to 0
               :Wait 0.1 Seconds
               :Key Input to [BUTTON PRESS]
           :End
           :Jump to Label 1
     :End
     :Key Input to [BUTTON PRESS]
     :Switch Operation [PAUSE] ON
     :Label 1
REST OF YOUR CODE

The wait times above are completely arbitrary, but generally make the system run smoother.  Now, all this little script does is check if a button is held down.  It'll take work on your part to integrate into your system.  You want to check for another button being pressed?  That's going to take more Key Input Processing, but make sure that you're sending the information to a variable other than the one you used here.

Hope that helps, good luck ^_^