button that simulates android keyboard input

600 views Asked by At

I have created a Love application but the game requires an on screen keyboard that has arrow keys, is it possible to create buttons on screen like a game pad that simulate keyboard input of keys like the arrow keys or letters?

1

There are 1 answers

1
Fyrn On BEST ANSWER

tl;dr: Use a more common touch input pattern like four touch-input quadrants of the screen.

It is possible but you would need to write an app to somehow pass the key-presses along with the android native keyboard which is a completely different question that is the beyond the scope of this answer.

Refer to the Android Input method documentation for help with that if you decide to go that route.

You could use something like:

if love.system.getOS() == "Android" then
    doVirtualKeyboadThings()
end

To detect that your game is running on android, Assuming that you want it to be multi-arch and then use something like Thranduil (Gui Libary) to create your own virtual keyboard.

However I can't encourage such a complicated workaround for something that could be accomplished with love.mouse (which uses touch events on android) and simple buttons or screen sections.

Example Image