Simulate Key Pressing

50 views
Skip to first unread message

LuFe_Mas

unread,
Feb 10, 2016, 8:29:12 PM2/10/16
to HaxeFlixel
There is a way to simulate the key press. Like if i want to configure the game pad, but i already did the entire game only with keyboard and virtual game pad. Or for the back button of Android. I want that the back button is the same as pressing [ESC]

Andrew Grothe

unread,
Feb 11, 2016, 7:19:08 AM2/11/16
to HaxeFlixel
You can do this by using proper abstraction when you code your game.

For example, put your code the for the [ESC] key in a separate function, then, call that function from both the [ESC] key press and from the Android back button. You might need a native extension for the Android back button though, not sure if that is build in.

Gama11

unread,
Feb 11, 2016, 8:31:06 AM2/11/16
to HaxeFlixel
You don't need a native extension for that, there's FlxG.android.

LuFe_Mas

unread,
Feb 12, 2016, 3:39:21 PM2/12/16
to HaxeFlixel
I thought thats there is another way.
Reply all
Reply to author
Forward
0 new messages