M32:ifhitkey

From EDukeWiki
Revision as of 10:28, 8 May 2022 by Doom64hunter (talk | contribs) (Created page with "ifhitkey <KEY_SC> This command will branch if the key specified by the scancode has been activated, or take the 'else' branch otherwise. While inside the block, the key status remains active. Once the branch block is exited, the key will be deactivated. See also: ifholdkey '''Usage:''' ifhitkey KEY_F { // do stuff if key active } else { // do stuff if key inactive } // key status is guaranteed de...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ifhitkey <KEY_SC>

This command will branch if the key specified by the scancode has been activated, or take the 'else' branch otherwise.

While inside the block, the key status remains active. Once the branch block is exited, the key will be deactivated.

See also: ifholdkey

Usage:

  ifhitkey KEY_F
  {
     // do stuff if key active
  }
  else
  {
     // do stuff if key inactive
  }
  
  // key status is guaranteed deactivated after the block