Question about new input devices functions

With this new core code added, can it be used to identify bluetooth keyboards and then be able to use those devices?

Yes, Corona currently supports all input devices that use the HID protocol… but only on Android.

This includes bluetooth keyboards.  I’ve tested bluetooth keyboard support myself and it works.  You’ll receive a Corona “key” event for every key on the keyboard.

Also that Corona now supports all keys via the Corona Simulator for Windows, but only when simulating an Android device.  However, the Corona Simulator currently does not provide device information yet, meaning you can’t differentiate between devices.  Also, the Corona Simulator does not provide key events when simulating an iOS device because iOS doesn’t support it. iOS only supports text input events, not key events, which is not the same thing.

I recommend that you try our “Hardware/KeyEvent” sample app that is included with the Corona Simulator.  Notice that it’ll display the key events coming from a bluetooth keyboard now.

Thanks for that info. I was hoping on allowing me to provide iCade support.

We actually looked into how the iCade works.  Since iOS does not support key events, the makers of the iCade worked-around this by setting up an invisible view which accepts text entry and having the iCade send characters to it when a button is pressed or when the joystick is moved.  For example, if you press button 1 down, then it’ll send a “Y” character.  If you release button 1, then it’ll send a “T” character.  It’s extremely unusual and a total hack, but it’s their only option since iOS does not support key events.

You can find more details about how the iCade works via the link here…

   http://www.thinkgeek.com/files/iCADE/iCade_Dev_Resource_v1_3.pdf

Theoretically, you should be able to support the iCade now by using a native TextField, give it the focus, and have the iCade send its characters to it.  Might be worth a shot if you already own an iCade.

Interesting :slight_smile: I think I’ll need a strong coffee to tackle this one, great to know it should be doable. Cheers Joshua.

Oh and if you have an Apple developer account, then check out their iOS 7 developer page under the “Games” section.  Apple will be introducing a new feature that our Input Device feature can take advantage of in the future.  Apple has it under NDA, so I can’t talk about it here, but I believe this is what you are looking for.  :)

Ok cool I’ll have a look at this and see if it works. Thanks again for the info

Yes, Corona currently supports all input devices that use the HID protocol… but only on Android.

This includes bluetooth keyboards.  I’ve tested bluetooth keyboard support myself and it works.  You’ll receive a Corona “key” event for every key on the keyboard.

Also that Corona now supports all keys via the Corona Simulator for Windows, but only when simulating an Android device.  However, the Corona Simulator currently does not provide device information yet, meaning you can’t differentiate between devices.  Also, the Corona Simulator does not provide key events when simulating an iOS device because iOS doesn’t support it. iOS only supports text input events, not key events, which is not the same thing.

I recommend that you try our “Hardware/KeyEvent” sample app that is included with the Corona Simulator.  Notice that it’ll display the key events coming from a bluetooth keyboard now.

Thanks for that info. I was hoping on allowing me to provide iCade support.

We actually looked into how the iCade works.  Since iOS does not support key events, the makers of the iCade worked-around this by setting up an invisible view which accepts text entry and having the iCade send characters to it when a button is pressed or when the joystick is moved.  For example, if you press button 1 down, then it’ll send a “Y” character.  If you release button 1, then it’ll send a “T” character.  It’s extremely unusual and a total hack, but it’s their only option since iOS does not support key events.

You can find more details about how the iCade works via the link here…

   http://www.thinkgeek.com/files/iCADE/iCade_Dev_Resource_v1_3.pdf

Theoretically, you should be able to support the iCade now by using a native TextField, give it the focus, and have the iCade send its characters to it.  Might be worth a shot if you already own an iCade.

Interesting :slight_smile: I think I’ll need a strong coffee to tackle this one, great to know it should be doable. Cheers Joshua.

Oh and if you have an Apple developer account, then check out their iOS 7 developer page under the “Games” section.  Apple will be introducing a new feature that our Input Device feature can take advantage of in the future.  Apple has it under NDA, so I can’t talk about it here, but I believe this is what you are looking for.  :)

Ok cool I’ll have a look at this and see if it works. Thanks again for the info

Hi. I have ben playing around with this and one problem I can see is that I need to detect if the device is connected or not, so to disable the keyboard popup. Also a way of detecting if the bluetooth device turns off or loses connection so i can also disable the keyboard popup. From reading I can only detect a device on Android. Is there anyway around this? Unless there is away to disable the keyboard popup without losing focus?

Calling native.setKeyboardFocus(nil) will remove the keyboard popup from the screen.

   http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html

However, by doing that you might lose keyboard input from your iCade completely because it will remove the focus from the text field.

There is also no Corona API or event that allows you to detect if the bluetooth keyboard has been connected/disconnected on iOS.  I can’t think of any work-arounds for detecting it.

Yeah you do lose focus. I could possibly ad a manual control but not having any device detection is a bit naff

Hi. I have ben playing around with this and one problem I can see is that I need to detect if the device is connected or not, so to disable the keyboard popup. Also a way of detecting if the bluetooth device turns off or loses connection so i can also disable the keyboard popup. From reading I can only detect a device on Android. Is there anyway around this? Unless there is away to disable the keyboard popup without losing focus?

Calling native.setKeyboardFocus(nil) will remove the keyboard popup from the screen.

   http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html

However, by doing that you might lose keyboard input from your iCade completely because it will remove the focus from the text field.

There is also no Corona API or event that allows you to detect if the bluetooth keyboard has been connected/disconnected on iOS.  I can’t think of any work-arounds for detecting it.

Yeah you do lose focus. I could possibly ad a manual control but not having any device detection is a bit naff

I just wanted to revisit this thread and see if iCade support has been added yet in Corona.