Page 1 of 1

Hardware keyboard compatibility (0.10.0)

Posted: Wed Dec 23, 2015 12:31 pm
by Joelghill
I'm playing with the new Love2D build for Android (0.10.0) and I have an Android device with a hardware keyboard. I'm trying to detect keyboard input from the device without any luck.

Should the standard keyboard input work on a device regardless of the OS? I've tried using love.keyboard.isDown, love.keyboard.isScancodeDown, and love.keypressed(key).

These all run on the desktop, but fail in the Android build with the built in hardware keyboard, and when an external keyboard is connected through USB.

Re: Hardware keyboard compatibility (0.10.0)

Posted: Wed Dec 23, 2015 12:58 pm
by Nixola
An external keyboard via USB works almost perfectly on Android 6.0.0. The Windows/Meta/Super key doesn't work (Android grabs it, as well as pagUp and Stamp) but neither do backspace, arrows and à, è, ì, ò, ù (IT layout), which apparently don't do anything. Only tested with keypressed.
P.S: Please enable quick reply for the Ports subforum, as switching to the desktop layout whenever I want to write a post in here is a bit tedious. The buttons are small, my fingers aren't.

Re: Hardware keyboard compatibility (0.10.0)

Posted: Thu Dec 24, 2015 5:48 pm
by Joelghill
Hey everyone, I found what the issue is!

I was testing the app on the BlackBerry Passport keyboard. Due to the unique design of their hardware, it looks like BlackBerry changed how the keyboard detects input for the Android runtime. A key press is detected as a press followed by an immediate release, and holding the key is then detected by a left shift press and immediate release.

Since the Passport is a super niche device with an uncommon keyboard design, this probably isn't an issue at all. I thought I may as well publish my findings somewhere though!

Cheers!