handling raw keys on android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
markhinnebusch
Posts: 40
Joined: Thu May 17, 2018 7:32 pm
Location: Florida, USA

handling raw keys on android

Post by markhinnebusch » Wed Oct 17, 2018 12:18 am

I'm trying to port my program to Chromebook by making it an Android app and so far, everything has worked fairly well. One problem that I have is that I need to capture keystrokes so that I can implement shortcuts in the app (for ADA compliance). It appears that the rawkeydown event is not being fired. I added an answer at the top of the handler and it shows the raw key code when i run it on Mac and Windows but not on the Chromebook. I've looked around in the livecode docs and maybe there is something there but if so, I couldn't find it. Any pointers would be very much appreciated.

thanks,
mark

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: handling raw keys on android

Post by bogs » Wed Oct 17, 2018 1:48 pm

The main problem your going to be facing isn't Lc related in this instance, but ChromeOs related.

While Google has recently started letting android apps run on it, they didn't do that by turning Chrome into android, they made a compatibility or virtual layer instead (like your app tester for android on the main desktop).

RawKeyDown works on supported desktops, mobile and server platforms, but how far any android app is going to work on Chrome will depend on how much of andoid's subsystem is supported and correctly implemented.

When I was doing a similar experiment last year (before google implemented all this stuff), I bypassed chrome completely and shoved crouton onto a chromebook I was borrowing for this experiment. Since that was a real 'nix implementation, all of the code more or less worked (after setting up the 'nix with additional libraries and such). The rawKey* statements all worked as you might expect them to in that environment.

I should add here that my testing buddy found that using Wine in that environment worked even better than the straight up 'nix program did. Go figure.
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: handling raw keys on android

Post by jacque » Wed Oct 17, 2018 6:14 pm

RawKeyDown works on supported desktops, mobile and server platforms, but how far any android app is going to work on Chrome will depend on how much of andoid's subsystem is supported and correctly implemented.
That makes sense, I'd expect Chromebooks to support only those things that mobile Android apps can do. There are no modifier keys on the on-screen keyboard so they aren't likely to be supported on the Chromebook.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: handling raw keys on android

Post by FourthWorld » Wed Oct 17, 2018 7:30 pm

bogs wrote:
Wed Oct 17, 2018 1:48 pm
RawKeyDown works on supported desktops, mobile and server platforms...
What would it do on a server?

I wonder if that's a docs error.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: handling raw keys on android

Post by bogs » Wed Oct 17, 2018 10:47 pm

Well, much as I hate to admit it, I haven't actually tested much server code :oops: but, if you ever come up with a reason to need to see the rawKey input somehow, like maybe receiving an ultra secret password or whatever, then you can come back and tell us if it actually works there :wink:
Image

markhinnebusch
Posts: 40
Joined: Thu May 17, 2018 7:32 pm
Location: Florida, USA

Re: handling raw keys on android

Post by markhinnebusch » Fri Nov 06, 2020 4:29 pm

I have returned to this issue since ADA support on Chromebook is getting more attention from my user base. I did some research and from the ChromeOS documentation, it appears that (according to Google) ChromeOS fully supports the android keyboard support. I retried intercepting raw key down and up in my LC app running on Chromebook and the events are not fired. Given what Google is saying about their support, I wonder if anyone can verify that rawKeyDown and rawKeyUp work on the Android. I can make a test app, but if anyone already knows, then I won't waste the time.

thanks,
Mark

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: handling raw keys on android

Post by FourthWorld » Fri Nov 06, 2020 6:13 pm

RawKeyDown is for LiveCode fields. On mobile it's strongly recommended to use a mobile-native field.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: handling raw keys on android

Post by richmond62 » Fri Nov 06, 2020 7:46 pm

RawKeyDown is for LiveCode fields. On mobile it's strongly recommended to use a mobile-native field.
Does that mean a mobile-native field cannot receive a virtual rawKeyDown/Up signal from the onboard virtual keyboard?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: handling raw keys on android

Post by FourthWorld » Fri Nov 06, 2020 8:12 pm

Mobile-native controls have their own mobile-native messages. Some are equivalent to those we use for LC fields, but they are a relatively slim subset of the full nuanced richness of LC field messages.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Android Deployment”