Native control, hidding keyboard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Native control, hidding keyboard
I've got an Android (5.1) device with a barcode scanner (integrated).
Works fine.
I would like to hide the keyboard, when the focus is set on a native control.
Or to say it differently : is it possible to have a field that will receive the characters sent by the barcode scanner, without displaying the virtual keyboard ?
Works fine.
I would like to hide the keyboard, when the focus is set on a native control.
Or to say it differently : is it possible to have a field that will receive the characters sent by the barcode scanner, without displaying the virtual keyboard ?
Re: Native control, hidding keyboard
Actually I have noticed that if I touch long enough on a native control (input)... the insertion cursor appears, there is focus, the content sent by the barcode scanner is displayed, but the keyboard doesn't show up.
So it's a progress !
Is there is a way to "emulate" this kind of long "mousedown" ? I could send the message, with an opencard for instance.
The native control would always keep the focus, but without the virtual keyboard.
So it's a progress !
Is there is a way to "emulate" this kind of long "mousedown" ? I could send the message, with an opencard for instance.
The native control would always keep the focus, but without the virtual keyboard.
-
- VIP Livecode Opensource Backer
- Posts: 9824
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Native control, hidding keyboard
If the field is not to be used by the user to edit directly, does it need to be a native editable field?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Native control, hidding keyboard
Yeah, I could use a regular livecode field instead.... but the behavior with the "long click" is different than with native control : the keyboard always shows up.FourthWorld wrote:If the field is not to be used by the user to edit directly, does it need to be a native editable field?
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native control, hidding keyboard
If the field is only for display, is there a reason not to use a locked LC field? Locked fields don't trigger the keyboard.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native control, hidding keyboard
To summarize my conundrumjacque wrote:If the field is only for display, is there a reason not to use a locked LC field? Locked fields don't trigger the keyboard.
-if i use native control input
When i long touch the control, insertion point comes, keyboard doesn't show up : that's good
but when the focus is lost (if i display an answer dialog for instance), I need to long touch AGAIN to have insertion point back.
-> the command mobileControlDo "xxxx", "focus" doesn't work on Android
-if i use a regular livecode text field
Whenever the field gets the focus, with insertion point, the virtual keyboard is showing up. that's bad.
So I guess, the solution would be to have a command to force the focus on a native control input (it means to get the insertion point)
Or to programmatically emulate the "long touch" on a regular livecode text field.
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native control, hidding keyboard
It would be helpful to know why you need an insertion point without the keyboard. If it just to designate where incoming text should go, that can be done in the script.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native control, hidding keyboard
Text is coming from the barcode reader, integrated to my android device.jacque wrote:It would be helpful to know why you need an insertion point without the keyboard. If it just to designate where incoming text should go, that can be done in the script.
It works the same way as a regular barcode scanner that you plug with on USB port to a PC : it emulates a "keyboard".
So on my Android device, I need a native control input, with focus, or a regular livecode field, in order to "catch" the text sent by the barcode reader.
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native control, hidding keyboard
Just a guess but try this:
Code: Select all
on keyUp pKey
put pKey after fld "barcode"
end keyUp
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native control, hidding keyboard
Unfortunately, if there isn't any focus (on a regular field or a native input control), KeyUp or KeyDown messages are not fired when the barcode scanner reads data.jacque wrote:Just a guess but try this:
Code: Select all
on keyUp pKey put pKey after fld "barcode" end keyUp
Re: Native control, hidding keyboard
OK i found a solution with regular livecode field
By using a... ask command !
This behavior would probably be seen as a bug.
I'm using LiveCode 8.1.1 with Android 5.1 device (tested on Android 4.1.1 device as well)
But right now, it solves my problem.
By using a... ask command !
Code: Select all
on opencard
select the text of field "barcode" ---- the virtual keyboard shows up
ask "Ready to work ?" ---- the virtual keyboard goes off
select the text of field "barcode" ---- the insertion point comes, ready to received scanned data, the virtual keyboard doesn't show up again
end opencard
I'm using LiveCode 8.1.1 with Android 5.1 device (tested on Android 4.1.1 device as well)
But right now, it solves my problem.
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native control, hidding keyboard
Did you try putting the keyUp handler in the card script? Keypress messages will go there if no field has focus.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native control, hidding keyboard
I did.jacque wrote:Did you try putting the keyUp handler in the card script? Keypress messages will go there if no field has focus.
Actually, if there is no focus (no insertion point in a field or a native input control), the characters sent by the barcode reader do not fire up the keyUp message.
Same issue with the "hard" keyboard (my android device has a small numerical keyboard too).
At least, this is the behavior is see with LiveCode 8.1 and 8.1.1 Indy on Android 5.1.
By the way, it might interest some readers. Here is the device I use : OCBS-D8000 :
http://www.ocominc.com/products/2014-Ne ... D8000.html
We use this device for inventory and other applications. Connected via wifi to a MySQL server... and sending queries to a Odoo server ! Smooth.
I bought a few, from this company (in Hong Kong), via their website on Alibaba. 350 USD each. Fast delivery. No problem.
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native control, hidding keyboard
That's a twist I didn't know, though it makes sense I guess that a mobile device wouldn't always be listening for keystrokes. On desktop, at least, the traversalOn property determines whether a field can get focus. I wonder what would happen if you tinker with turning it on and off. It's a long shot I admit. I'm thinking there has to be some way around the problem but like you, I can't think of it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native control, hidding keyboard
Dear Fellas,
Can someone give me a mighty hand of help, otherwise i'm just gonna kill meself. I can't make the bloody thing to check if "field" is not empty then delete everything and do keyDown. It empties the field but doesn't do any input whatsoever.
local tCard
local tFieldText
However, if I run this code it works perfectly!
Thank you
Can someone give me a mighty hand of help, otherwise i'm just gonna kill meself. I can't make the bloody thing to check if "field" is not empty then delete everything and do keyDown. It empties the field but doesn't do any input whatsoever.
local tCard
local tFieldText
Code: Select all
on KeyDown theKey
if field "Barcodes" is not empty then
put empty into fld "Barcodes"
pass KeyDown
put theKey after fld "Barcodes"
put fld "Barcodes" into tFieldText
put "A" & tFieldText into tCard
go to card tCard
else
pass KeyDown
put theKey after fld "Barcodes"
put fld "Barcodes" into tFieldText
put "A" & tFieldText into tCard
go to card tCard
end if
end KeyDown
Code: Select all
on KeyDown theKey
put theKey after fld "Barcodes"
put fld "Barcodes" into tFieldText
put "A" & tFieldText into tCard
go to card tCard
end KeyDown