Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on April 10, 2017, 07:32:16 AM

Title: Lock The Mouse Buttons
Post by: Rabagast on April 10, 2017, 07:32:16 AM
Hi!
Is it possible to lock the mouse button to prevent to send an event when I click outside the inputfield with the mouse button? To be more specific.
When the game is over, I can write my name to get a place on the highscore list, but if I click with the mouse button outside the inputfield, it submit the name. I don't want that. I want the cursor to be in the inputfield until I click enter. Is it a way to do that?
Title: Re: Lock The Mouse Buttons
Post by: jeanfabre on April 11, 2017, 01:39:09 AM
Hi,

 It's because you need to catch inputFields event differently, for this case, you need as you said it watch for the enter Key so when you get the InputField Event you ask if the enter key was pressed and if not you don't do anything.

Bye,

 Jean
Title: Re: Lock The Mouse Buttons
Post by: Rabagast on April 11, 2017, 03:41:31 AM
Hi, Jean!

The problem is when I use "U Gui Input Field On Submit Event". It will also submit when I click with the mouse button outside the inputfield. I think, when I'm in the state where I can write my name, it's better to just use "Get Key Down" Or what do you think?
Title: Re: Lock The Mouse Buttons
Post by: jeanfabre on April 12, 2017, 02:39:05 AM
Hi,

 yes, OnSubmit works for both enter and esc ( which is really odd I give you that...)

yes you can catch the enter key being pressed, that's a good approach.

 Bye,

 Jean