Hardware keyboard compatibility (0.10.0)

A project to port LÖVE to Android handhelds
Locked
Joelghill
Prole
Posts: 3
Joined: Mon Jul 02, 2012 11:26 pm

Hardware keyboard compatibility (0.10.0)

Post 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.
Last edited by Joelghill on Wed Dec 23, 2015 1:01 pm, edited 1 time in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Hardware keyboard compatibility (0.10.0)

Post 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.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Joelghill
Prole
Posts: 3
Joined: Mon Jul 02, 2012 11:26 pm

Re: Hardware keyboard compatibility (0.10.0)

Post 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!
Locked

Who is online

Users browsing this forum: No registered users and 6 guests