Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation
This topic is the discussión abut the function BlzTriggerRegisterPlayerKeyEvent. You can see all the information about this function keyword HERE.

[functions] BlzTriggerRegisterPlayerKeyEvent No New Posts Jassdoc

Started by
City17

0 Members and 1 Guest are viewing this topic.

[functions] BlzTriggerRegisterPlayerKeyEvent
on: April 17, 2022, 04:53:22 PM

Registers event to call whichTrigger when player presses a key + metakey. Key presses are synced by the game between players automatically.
If keyDown = false, trigger is called once when key is released (unpressed).
If keyDown = true, calls trigger repeatedly while key is being held down. Approximately 30 times per second and fluctuating.

Meta keys are modifier keys like CTRL, SHIFT, ALT. See: BlzGetTriggerPlayerMetaKey. If you just want a key press without them, use 0.

Example:
Code: Lua
  1. trg_key = CreateTrigger()
  2. -- prints oskey as object, metakey as integer
  3. TriggerAddAction(trg_key, function() print(BlzGetTriggerPlayerKey(),  BlzGetTriggerPlayerMetaKey()) end)
  4.  
  5. -- register key press ESCAPE
  6. BlzTriggerRegisterPlayerKeyEvent(trg_key, Player(0), OSKEY_ESCAPE, 0, false)
  7.  
  8. -- register key press CTRL+1
  9. BlzTriggerRegisterPlayerKeyEvent(trg_key, Player(0), OSKEY_1, 2, false)



 

Started by moyack

Replies: 3
Views: 3816
Jassdoc

Started by Jedi

Replies: 5
Views: 14398
General Jass Discussion

Started by moyack

Replies: 40
Views: 57337
Jass Theory & Questions

Started by moyack

Replies: 0
Views: 396
Jassdoc

Started by moyack

Replies: 0
Views: 406
Jassdoc
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...