Page 1 of 1

Triggering Touch Objects with Keyboard Input

Posted: 24 Oct 2019, 16:22
by mtyndorf
Hey Guys

Bit of a new user here, but I have an application that uses touch objects as targets via a touchscreen. Think of something similar to a dartboard.

The user throws a ball at the screen target which registers a hit on a touch object, but in case the touch screen doesn't respond quickly enough (and its an obvious hit) I need to be able to have a moderator hit a key on the keyboard to trigger the selected target.

I've tried using Keyboard inputs but the direction in the hierarchy is wrong.. I need it to accept a keypress input and trigger a touch object instead of the touch object triggering a keyboard input.

I'm sure this is pretty simple but I'm just not seeing it right now. Any thoughts?

Thanks!

Re: Triggering Touch Objects with Keyboard Input

Posted: 25 Oct 2019, 11:38
by lerou
Your triggers (key and touch) should not try to trigger each other. Instead both should trigger whatever reaction you have. So for instance, if you have an animation and your touch object triggers next on that animation, your node for the key should also trigger that next method.

More generally you could create a trigger container that contains both your touch node and a key node. And they both trigger an event. The event node's outgoing fired event is then exposed, so from outside the container it's transparent whether a touch or a key has triggered the output event. Then react to that event.

Re: Triggering Touch Objects with Keyboard Input

Posted: 25 Oct 2019, 16:27
by mtyndorf
That's what I understand, but whenever I try tying the Emit event from the keypress to the Mover node which does the animation, the directional arrow is going from the Mover to the WindowKey node. From what I understand the arrow needs to go from the Keyboard node TO the mover node in order to trigger the motion, but I don't understand why it won't let me... is there a way to change the direction of the arrow or am I supposed to use something other than the "Emit" attribute to send the command to the mover node?

Re: Triggering Touch Objects with Keyboard Input

Posted: 28 Oct 2019, 09:55
by lerou
Emit is a method, so it's an input. You need to drag the Mover's Nudge merhod (input) to on of the Key's outgoing events (KeyDown or KeyUp)