• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Left click is a MetaKey? (PTR)

Status
Not open for further replies.
Level 3
Joined
Mar 3, 2018
Messages
15
Hi everyone.
This code:
Code:
function test1()
   keytrig = CreateTrigger()
   function key()
      print("key")
   end
   BlzTriggerRegisterPlayerKeyEvent(keytrig,Player(0),OSKEY_W,0,true)
   TriggerAddAction(keytrig,key)
end
doens't work if I hold down the left click (works fine with right click and middle click), just like it doesn't work if I hold down SHIFT or ALT, becouse both are MetaKey and I passed 0 as integer.
I deduced that the left click acts like a metakey, but I tried giving from -1000 to 1000 as integer in the event and nothing changed.

So my question is, what is the problem here? Why doesn't the code work when I hold down the left click? It's becouse it is a MetaKey? And if so, what integer? Or is it just a bug?
I'd like to hear someone's tought about this, it would be really helpful for my map.

Thank for your time.
 
Does the left clicking always blocks the keyevent or do you have to click onto a specific part of the screen?
(UI, PlayAble World)

I created some clickable UI Buttons which stole the key focus after beeing clicked (which disabled hotkeys), Left clicking on the playable world returned the key focus.

Unsure if that helps you in any way.
 
Level 3
Joined
Mar 3, 2018
Messages
15
Hey thanks for your reply.
Now that I tried actually it only happens when I click on the playable map. This gave me a couple of idea of how to fix this problem in my map but they are not very "nice" I mean I would like not to use them.
Do you think there's something I can do to fix this in a easy way?

Thanks again, I'm able to progress again.
 
Status
Not open for further replies.
Top