Page 1 of 1

Android: trouble with SwiftKey

Posted: Mon Dec 19, 2016 12:02 am
by zylesea
This is an Android related issue.
I tried my App with Swiftkey on a Samsung phone today. And with Swiftkey the text input does not work. I use an event driven input like this:

Code: Select all

Function p_HandlerFunc(msg)
  Switch (msg.action)
   Case "OnKeyDown":
     If kbd$=1 Then p_enter_text(msg.key)   ;kbd$ gets set to 1 if the keyboard gets shown
    Case "OnMouseDown": 
        HideKeyboard()      
        kbd$=0           
endswitch

With Android's standard keyboard this works as expected, as well as it does with the standard Samsung one, but with Swiftkey the keyboard gets hidden once the finger touches the keyboard. I.e. it seems to me that with Swift key not the event key down, but onMouseDown gets triggered.
Anyone experience with Swift key? I heard it's a pretty wide spread keyboard.

Re: Android: trouble with SwiftKey

Posted: Wed Dec 21, 2016 10:11 pm
by airsoftsoftwair
Works fine here on on my Nexus 5X running Android 7. Here's my test script:

Code: Select all

ShowKeyboard

InstallEventHandler({OnKeyDown = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
	OnKeyUp = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
	HideKeyboard = Function(msg) DebugPrint(msg.action) EndFunction})
 
Repeat
	WaitEvent
Forever	
Which Android version are you on?

Re: Android: trouble with SwiftKey

Posted: Sat Dec 31, 2016 2:05 am
by zylesea
airsoftsoftwair wrote:Works fine here on on my Nexus 5X running Android 7. Here's my test script:

Code: Select all

ShowKeyboard

InstallEventHandler({OnKeyDown = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
	OnKeyUp = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
	HideKeyboard = Function(msg) DebugPrint(msg.action) EndFunction})
 
Repeat
	WaitEvent
Forever	
Which Android version are you on?

Cannot say anything about the devic I was talking in my original post as it isn't mine. But I installed Swiftkey on my Nexus7 Android 5.1.1 now and the problem I wrote above happens there, too. If the keyboard is shown a touch outside the keyboard area does not get recognized at all. But a touch on the keyboard gets an OnMouseDown message, but no OnKeyDown message.
I thought it may be an issue of the very first touch when Swiftkey gets showns, but when I remove the hideKeyboard routine I still get _only_ OnMouseDown events and _no_ OnKeyDown or OnKeyUp events.

With the google keyboard everything is fine.

Re: Android: trouble with SwiftKey

Posted: Tue Jan 03, 2017 10:24 pm
by airsoftsoftwair
I've tested it again, this time also on Android 4 and 6. Unfortunately, I don't have an Android 5 device. I modified the script to also log "OnMouseDown" events. Here is the test script:

Code: Select all

@DISPLAY {Color = #RED, ScaleMode = #SCALEMODE_AUTO, FitScale = True}

ShowKeyboard

InstallEventHandler({OnKeyDown = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
   OnKeyUp = Function(msg) DebugPrint(msg.action, msg.key) EndFunction,
   HideKeyboard = Function(msg) DebugPrint(msg.action) EndFunction,
   OnMouseDown = Function(msg) DebugPrint(msg.action) EndFunction})
 
Repeat
   WaitEvent
Forever   
It works correctly on Android 4, 6, and 7. Tapping outside the keyboard area correctly reports "OnMouseDown" and tapping the keyboard only reports key events, but not "OnMouseDown". Can you test exactly the script I posted above? Maybe the problem is somewhere else.

Re: Android: trouble with SwiftKey

Posted: Fri Jan 06, 2017 11:02 pm
by zylesea
I tested with your script. With the standard keyboard it works as expected, but with SwiftKey as reported above.
Here's a logcat:

Code: Select all

I/threaded_app(13181): New input event: type=2
I/threaded_app(13181): New input event: type=2
I/LogTag  (13181): OnMouseDown
I/LogTag  (13181):
I/threaded_app(13181): New input event: type=2
I/threaded_app(13181): New input event: type=2
I/LogTag  (13181): OnMouseDown       
Taping on a key gives an OnMouseDown event, tapping outside the keyboard area (the red area) gives no event at all (hence no debug output). Weird.

Re: Android: trouble with SwiftKey

Posted: Sun Jan 15, 2017 9:51 pm
by airsoftsoftwair
Hmm, I'm afraid there's not much I can do here without having a test device. Remote debugging is also not really possible because I wouldn't know where to start. But as I said, I've tested it on 3 different devices here (4, 6, and 7) and they all work fine. So let's hope that not too many devices are affected. Of course, if you want to send in your device I can debug this but I guess that's probably not a viable option for you. Maybe it's really just a bug in Android 5.

Re: Android: trouble with SwiftKey

Posted: Wed Jan 18, 2017 1:08 am
by zylesea
Thanks for having looked into it. Seems weird, but probably not too important. It's good to know that it is only an Android 5 issue. As long as I can assume Swiftkey and Hollywood is compatible on other Android versions that's okay, for Android 5 users I add a note.
For _my_ taste Swiftkey is too much a spy-ware anyway...