Native field with focus and no keyboard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Native field with focus and no keyboard
Hi smartpeople, there is probably an obvious way to do it but I can't find it...
I have a native input field, with focus, waiting for a barcode scanner to place its reading on it.
The problem is: I would like to hide the keyboard since the input data is to come from the barcode scanner only.
How can this be acomplished?
As always, many thanks in advance
I have a native input field, with focus, waiting for a barcode scanner to place its reading on it.
The problem is: I would like to hide the keyboard since the input data is to come from the barcode scanner only.
How can this be acomplished?
As always, many thanks in advance
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Native field with focus and no keyboard
Presumably you mean the virtual keyboard on either an Android or a iOS device.to hide the keyboard
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
Yes, sorry for not being clear enough.Presumably you mean the virtual keyboard on either an Android or a iOS device.
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Native field with focus and no keyboard
LiveCode doesn't like me:
But this might work:
WARNING: I have never made anything for Android or iOS and 100% don't know what I'm talking about:
merely pissing around with what I found in the Documentation by typing 'keyboard'.
Code: Select all
on mouseUp
set the keyboardActivated to false
end mouseUp
Code: Select all
on mouseUp
set the keyboardType of fld "fff" to empty
end mouseUp
merely pissing around with what I found in the Documentation by typing 'keyboard'.
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
Thanks Richmont, unfortunatly not joy...
Still betting that someone will know how to do it.
Regards
Still betting that someone will know how to do it.
Regards
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
Re: Native field with focus and no keyboard
I don’t do Android, but I seem to remember seeing on the forums something like
To deactivate the field and make the keyboard disappear.
Only a vague memory but hope it helps.
Code: Select all
Focus on nothing
Only a vague memory but hope it helps.
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
Thanks @kdjanz.
Your memory is good: focus on nothing will hide the keyboard but will also take the focus out from the field and I need the focus to remain on it in order to receive the scanner data.
Your memory is good: focus on nothing will hide the keyboard but will also take the focus out from the field and I need the focus to remain on it in order to receive the scanner data.
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native field with focus and no keyboard
Try setting the editable of the field to false. This apparently only works for multiline fields but you can make it show only one line by adjusting the height.
But if the field is just for display I don't think you need a native field at all. You could just use a locked LC field, unless you need the clipboard actions.
Code: Select all
mobileControlSet tControl, "editable", false
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
Hi Jacque, thanks for your suggestion
What I actually need is the equivalent to "Focus with Keyboard = False" for a native field...
The next question would be why do I have to use a native field instead of a "regular" one to receive the scanner input. I don't know the answer but the fact is the scanner works OK with a native field and just the first digit is captured when a "regular" field is used...but this should be the subject of another post
The scanner needs the field to have focus in order to be able to receive the data being captured. With editable being false then no reading is captured...Try setting the editable of the field to false
The field is not just for display, it has to receive the data that is read by the scannerBut if the field is just for display I don't think you need a native field at all
What I actually need is the equivalent to "Focus with Keyboard = False" for a native field...
The next question would be why do I have to use a native field instead of a "regular" one to receive the scanner input. I don't know the answer but the fact is the scanner works OK with a native field and just the first digit is captured when a "regular" field is used...but this should be the subject of another post
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native field with focus and no keyboard
Okay, that's very strange. I was going to suggest, as a test, a LC field with both traveralOn and locktext set to true but if LC fields don't work then neither will my idea. I can't test since I don't have the necessary hardware, but years and years ago (before mobile was available) I made an app that captured bar code scans and LC fields received the entire data. The client is still using the app and it still works; last compile was with LC 9.0 I believe.simon.schvartzman wrote: ↑Wed Mar 03, 2021 9:15 pmThe next question would be why do I have to use a native field instead of a "regular" one to receive the scanner input. I don't know the answer but the fact is the scanner works OK with a native field and just the first digit is captured when a "regular" field is used...but this should be the subject of another post
There may be a way to force a LC field to receive all the data, maybe it's a timing issue or similar. If I recall, I was using keyUp to capture the data since the scanner sent the characters as key presses. Is that how your hardware works?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
@Jacque see remarks below
Then I decided to test on the iPhone simulator ( iOS 13.3) and it works as well.
So it doesn't work just on Android (6.0) unfortunatly the only device I have available for testing
the same code on Android just shows the first character two times as well.
I guess this is a bug and I will report it as such on the Quality board
inspired by the above I tested an App (with just a LC field) on Mac (Mojave) with and guess what? It worked fine, the whole code was read as expected....but years and years ago (before mobile was available) I made an app that captured bar code scans...
Then I decided to test on the iPhone simulator ( iOS 13.3) and it works as well.
So it doesn't work just on Android (6.0) unfortunatly the only device I have available for testing
Handling keyUp is not needed on Mac but if I do like below, then each character is shown twice (same on iPhone)I was using keyUp to capture the data since the scanner sent the characters as key presses. Is that how your hardware works?
Code: Select all
on keyUp pKeyName
put pKeyName after field "barcode"
end keyUp
I guess this is a bug and I will report it as such on the Quality board
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native field with focus and no keyboard
I probably remembered wrong. Try keyDown instead. That should eliminate the double characters.
But the Android issue does sound like a bug (assuming keyDown still fails.)
But the Android issue does sound like a bug (assuming keyDown still fails.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: Native field with focus and no keyboard
Jacque, uour memory is OK, I saw an old post from you about the subject where you mention keyUp.
Anyway as I said above LC "regular" fields works OK on Mac without the need of keyUp or KeyDown.
I've opened a bug report regarding Android behaviour.
Will see. Meanwhile I will need to cope with Native Field and Keyboard being shown.
Thanks for all
Anyway as I said above LC "regular" fields works OK on Mac without the need of keyUp or KeyDown.
I've opened a bug report regarding Android behaviour.
Will see. Meanwhile I will need to cope with Native Field and Keyboard being shown.
Thanks for all
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native field with focus and no keyboard
In your report, ask if the team has any suggestions. I can't think of a workaround for now.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com