• 🏆 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 Ruins Arrow Key inputs? Any Fix?

Status
Not open for further replies.
Level 4
Joined
Apr 16, 2018
Messages
47
Well, I have need of the arrow key inputs, but whenever I release one of them while the left click on my mouse is pressed down; it does not register the release happening. So the button remains showing as pressed which is really not good if you have movement tied to it for example. You have to repress and release it just to unset it before moving normally.

Is there any way to fix it so that left click does not effect them at all?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
That sounds strange.

Can you try this in an empty map to make sure it is not another trigger that messes it up somehow.
And, if so share the map so it can be downloaded and tested.

I'm not gonna say it's impossible but I have never heard of it before and it sounds like a very common problem if you could not use mouse and arrow keys in paralel.
 
Level 4
Joined
Apr 16, 2018
Messages
47
Here you go. Appreciate the help. Pretty big for me to figure out a fix for this T.T ...
 

Attachments

  • Arrow Key & Left Mouse Issue Demo.w3m
    19.6 KB · Views: 9
Last edited:
Level 18
Joined
Jan 1, 2018
Messages
728
Here's a simple workaround:
  • Untitled Trigger
    • Events
      • Player - Player 1 (Red) issues Mouse Down event
    • Conditions
      • (Trigger Mouse Button) Equal to Left Mouse Button
    • Actions
      • Cinematic - Disable user control for Player Group - Player 1 (Red)
      • Cinematic - Enable user control for Player Group - Player 1 (Red)
This will disable drag selection though.
 
Level 4
Joined
Apr 16, 2018
Messages
47
Here's a simple workaround:
  • Untitled Trigger
    • Events
      • Player - Player 1 (Red) issues Mouse Down event
    • Conditions
      • (Trigger Mouse Button) Equal to Left Mouse Button
    • Actions
      • Cinematic - Disable user control for Player Group - Player 1 (Red)
      • Cinematic - Enable user control for Player Group - Player 1 (Red)
This will disable drag selection though.
Unfortunately does not seem to fix the problem. Tried it in the demo map attached here, and on my actual product. Same issue persists. xD
 
Level 5
Joined
Oct 16, 2007
Messages
67
Yes, Warcraft 3 dosen't register that if you hold the left mouse button.

Do you need to select units? Otherwise you can just put a invisible UI-Rectanlge across the screen. Then you can click left as much as you want. However you loose the ability to select items and units.
 
Level 4
Joined
Apr 16, 2018
Messages
47
I need the ability to see where my mouse is in relation to my character, and also be able to click to shoot in that direction. I do not really need to select things. I notice that the mouse works fine with the bottom ui, but if moved over the top ui the tracking of mouse tracking is ruined, but it no longer causes the issue stated here. So this I can see is indeed one way to fix, but unfortunately it also adds a new problem that may be a tad worse for my map. T.T

At least I assume that the top of ui by default is the thing you replicate by doing that with rectangle. Not sure how to even do that one.
 
Level 18
Joined
Jan 1, 2018
Messages
728
You could use the right mouse button instead of left for shooting, since this issue only happens with left mouse button.
You could also use a keyboard button for shooting.
 
Level 4
Joined
Apr 16, 2018
Messages
47
You could use the right mouse button instead of left for shooting, since this issue only happens with left mouse button.
You could also use a keyboard button for shooting.
Yea, that is the plan if I absolutely cannot find a way to solve the issue. =/
It is just a bit odd/awkward to use the right click instead of left click which most games use. So Ideally fixing the left click if possible, but if absolutely not I will have to use others sadly. =/
 
Level 5
Joined
Oct 16, 2007
Messages
67
Sorry for the late reply.

It's something I started with someone as a Team, but we stopped working on it after a few days...
Maybe it can help you.
 

Attachments

  • Arena_Shooter_0.01.w3m
    41.5 KB · Views: 8

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
This issue is easily resolved with this native:
JASS:
native BlzTriggerRegisterPlayerKeyEvent            takes trigger whichTrigger, player whichPlayer, oskeytype key, integer metaKey, boolean keyDown returns event
instead of:
JASS:
native TriggerRegisterPlayerEvent takes trigger whichTrigger, player  whichPlayer, playerevent whichPlayerEvent returns event
 
Level 4
Joined
Apr 16, 2018
Messages
47
This issue is easily resolved with this native:
JASS:
native BlzTriggerRegisterPlayerKeyEvent            takes trigger whichTrigger, player whichPlayer, oskeytype key, integer metaKey, boolean keyDown returns event
instead of:
JASS:
native TriggerRegisterPlayerEvent takes trigger whichTrigger, player  whichPlayer, playerevent whichPlayerEvent returns event
Sorry, little confused. How and where to implement this fix? I'm a gui user mainly. Could just be dumb and this is obvious. xD
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Sorry, didn't know that.
JASS:
call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(0), OSKEY_LEFT, 0, true)
This adds an event to when player red presses left arrow key, hence why last argument is true)
JASS:
local integer i = 0
loop
    exitwhen i > 11
    //press
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_LEFT, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_RIGHT, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_UP, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_DOWN, 0, true)
    //release
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_LEFT, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_RIGHT, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_UP, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_DOWN, 0, false)
    set i = i + 1
endloop

Players' index in JASS start from 0. This should be added from a initialization trigger and added to your respective triggers that deal with pressed and released events.

Perhaps it's time for you to learn even more cool stuff in JASS ;)
 
Level 4
Joined
Apr 16, 2018
Messages
47
Sorry, didn't know that.
JASS:
call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(0), OSKEY_LEFT, 0, true)
This adds an event to when player red presses left arrow key, hence why last argument is true)
JASS:
local integer i = 0
loop
    exitwhen i > 11
    //press
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_LEFT, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_RIGHT, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_UP, 0, true)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName, Player(i), OSKEY_DOWN, 0, true)
    //release
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_LEFT, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_RIGHT, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_UP, 0, false)
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TriggerName2, Player(i), OSKEY_DOWN, 0, false)
    set i = i + 1
endloop

Players' index in JASS start from 0. This should be added from a initialization trigger and added to your respective triggers that deal with pressed and released events.

Perhaps it's time for you to learn even more cool stuff in JASS ;)
Thank you, but I will be overwhelmed if I do. Already trying to learn coding in unreal engine 4 so I am trying to keep it simpler here. xD Id be overwhelmed. Have issues with remembering all the coding stuff even when I initially tried. Not the best of memory. I am not opposed to learning some here and there. I sprinkle it in a bit, and have a little bit of understanding from attempts at coding before. Thus I can make a tad understanding of the code when I see it, but not enough. xD
 
Status
Not open for further replies.
Top