M32:ifhitkey: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
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..."
(No difference)

Revision as of 11:28, 8 May 2022

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