playMaker

Author Topic: GUI KeyBoard Event  (Read 4373 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
GUI KeyBoard Event
« on: May 28, 2013, 07:35:46 AM »
Hi,

 Following a post, please find an action that will catch keys and send an event.

 this is very useful if you have a text field and want to validate the contetn when the user press Enter for example. Put this action BEFORE the textfield action and it will fire the event before the enter key makes it to the text field.

Use the Ecosystem to conveniently get it in your project or:

Download GuiKeyBoardEvent

GuiKeyboardEvent source code

bye,

 Jean
« Last Edit: February 17, 2015, 03:40:16 AM by jeanfabre »

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: GUI KeyBoard Event
« Reply #1 on: October 27, 2014, 08:06:45 PM »
This is a really nice action but there is one thing that can go wrong with it.

If you want a reusable text field, you won't be able to clear the line return it puts in the text field. (Changing the string back to empty doesn't fix it) The user has to manually use backspace.

It would be amazing if the return character for it could be made not to go into the text field, but so far I can't find a way in playmaker.

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: GUI KeyBoard Event
« Reply #2 on: October 28, 2014, 10:39:40 AM »
This is a really nice action but there is one thing that can go wrong with it.

If you want a reusable text field, you won't be able to clear the line return it puts in the text field. (Changing the string back to empty doesn't fix it) The user has to manually use backspace.


Hi, I had this issue too, but today got it to work :)

Have a setup like you I guess, in the State where you put that string back to empty add another action Delete Line with -1, then after this state add a new state with Next Frame Event action and set it to Finished so it have a one frame time to actually delete that extra line in the text field.

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: GUI KeyBoard Event
« Reply #3 on: October 28, 2014, 12:11:01 PM »
Thanks! That definitely helped me to get it to work for my project. I had to actually use two next frame events, one in the changing state then another in an empty one after it... and that works for my system.

No clue why but at least it works. Great advice!

Also if anyone else coming across this you have to download the String Delete Line action here first, it's not a standard one.

szomaza

  • Sr. Member
  • ****
  • Posts: 253
Re: GUI KeyBoard Event
« Reply #4 on: February 18, 2015, 01:14:49 AM »
StringDeleteLine  is here:
http://hutonggames.com/playmakerforum/index.php?topic=1131.0

Thanks,
szomaza