Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Graham on March 16, 2015, 04:26:56 PM

Title: Input Broker
Post by: Graham on March 16, 2015, 04:26:56 PM
I read this Unity Answer by Jean Fabre: http://answers.unity3d.com/questions/28473/simulating-key-presses.html (http://answers.unity3d.com/questions/28473/simulating-key-presses.html)

Can this functionality be made into an action for simulating key presses?
Title: Re: Input Broker
Post by: jeanfabre on March 18, 2015, 05:16:34 AM
Hi,

 Unfortunatly, that would mean editing the official actions ( for portability), so within Playmaker, I do it differently, because of PlayMaker nature.

 basically, you create your own input broker by having your fsm not rely on the unity  set of input function but yours. and everytime you want to listen to a key press you listen to both the keypress AND a custom keypress flag that you can raise from another fsm.

 so if an fsm wants to do something on  y key press, it should not itself try to catch this keypress, but you should create a fsm that manage inputs and fire a global event "MY KEY PRESSED", that fsm will catch, and so these fsm don't care how ti was triggered, and you can fake keypress very easily then.
 
Does that make sense?

Bye,

 Jean
Title: Re: Input Broker
Post by: Graham on March 18, 2015, 01:40:16 PM
Thanks for the info Jean. I was hoping for the actual simulated key press so that it would work with unity's input manager and not require a workaround to get the horizontal easing that is built in, and not need two sets of logic. However I am going another route, and it was not as tedious as I had worried it would be.