Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Oddball 'Head-Scratcher' on Android

Author
Message
KultiVator
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: Sunny Northamptonshire
Posted: 27th Nov 2017 10:15 Edited at: 27th Nov 2017 10:18
Hi All,

I'm working on a project where the target device is an Android tablet with a USB numeric keypad attached for input/interaction. The Android tablet detects the keypad and it works flawlessly in Android apps that accept normal text input. However in AppGameKit V2 apps, I'm struggling to get it to work via the usual keyboard-centric commands (e.g. GetRawLastKey / GetRawKeyPressed / etc) for the main numeric keys. Oddly, the numeric keypad's TAB and DEL keys work fine.

I believe the numeric keypad is a HID (human interface device) class of device - and wondered if there's anything special I need to do to detect the keys (e.g. will AppGameKit on Android only see this as a joystick/joypad kind of device?)

Just to throw in one final detail, when testing in Windows, the numeric keypad behaves exactly as I would have expected - with GetRawLastKey / GetRawKeyPressed working 100% fine for all numeric + all other keys.

Grateful for any thoughts / suggestions - would be great to get past this minor hitch in my adventure on Android!

p.s. Here's a link to the numeric keypad...

https://www.amazon.co.uk/UrChoiceLtd®-Mechanical-Magicforce-Financial-Securities-Black-Blue-Switch/dp/B074VX8J3X/ref=sr_1_11?ie=UTF8&qid=1511777665&sr=8-11&keywords=usb+backlit+numeric

Best Regards,



KV
( Aggravated > Constipated > Mutilated ) < KultiVated
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th Nov 2017 15:02
It depends what key codes the keyboard is sending. You can see a list of codes recognised by AppGameKit in "Tier 2\apps\interpreter_android_google\AGKPlayer2\src\main\jni\Core.cpp" in the TranslateKey function. The Android LogCat output in Android Studio should list the key codes that are being sent by Android. If you can find out which codes correspond to which keys I may be able to add them to the list.
KultiVator
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: Sunny Northamptonshire
Posted: 28th Nov 2017 16:54 Edited at: 28th Nov 2017 17:00
Hi Paul,

Many thanks for the response - unfortunately I'm a lowly "Tier 1" user at this point. However, I'll do some digging and see if I can find a way to detect the keyboard scan-codes under Android (under Windows the scan-codes detected by my AppGameKit / Delphi code are just what you'd expect).

Some extra notes for anyone else facing similar issues on Android in the future:

* the HID keypad isn't seen as a joystick / game-controller on Android, since calling GetJoystickExists() results in a result of zero/false.
* calling GetKeyboardExists() results in one ("Full Sized Keyboard Detected")
* Other than the keypad's Tab and Backspace key, none of the other keys seem to trigger a scan-code that AppGameKit V2 recognises.

Still searching for a way forward, if anyone has any ideas, please drop a response in below.

Many thanks,


KV
( Aggravated > Constipated > Mutilated ) < KultiVated

Login to post a reply

Server time is: 2024-11-28 00:16:30
Your offset time is: 2024-11-28 00:16:30