Martiny Posted April 13, 2014 Share Posted April 13, 2014 I'm wondering if there is a way of simulating a mouse click (or touch) on a sprite with a keyboard press. For instance, imagine I have two images, both with a function that when I click on them, the sprite I clicked gets killed. I wanted to click "1" and the first would get killed, and then "2" and the second would get killed. I guess the easier way to achieve this is to simulate a click event in the corresponding sprite when I press '1' or '2', but I don't know how to do it. Is there a way of simulating a mouse click in a specific position (x and y) or on a sprite by a keyboard press? Link to comment Share on other sites More sharing options...
XekeDeath Posted April 14, 2014 Share Posted April 14, 2014 You could attach the same function to the onDown event of the key press and the onClick event of the sprites. Martiny 1 Link to comment Share on other sites More sharing options...
Recommended Posts