Android Keyboard - Using "Sentence" Option.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Android Keyboard - Using "Sentence" Option.
Hii Guys!
I have in the past viewed a way to set the Android keyboard to a "Sentence" option. Essentially when a key is pressed, the character will automatically set the case to uppercase. I have searched the dictionary for "Keyboard" but can't seem to find the information I need.
Any help is greatly appreciated!
Many Thanks,
Matt.
I have in the past viewed a way to set the Android keyboard to a "Sentence" option. Essentially when a key is pressed, the character will automatically set the case to uppercase. I have searched the dictionary for "Keyboard" but can't seem to find the information I need.
Any help is greatly appreciated!
Many Thanks,
Matt.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Android Keyboard - Using "Sentence" Option.
I think you need to look at toUpper.
- -
- -
Code: Select all
on keyDown KD
put KD into KEYD
put toUpper(KEYD) after fld "ff"
end keyDown
- Attachments
-
- Upper Case.livecode.zip
- Stack
- (4.02 KiB) Downloaded 187 times
Last edited by richmond62 on Thu May 29, 2025 8:48 am, edited 2 times in total.
Re: Android Keyboard - Using "Sentence" Option.
I have tried that. I would like to show a Capital on the keyboard also.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Android Keyboard - Using "Sentence" Option.
I don't think LiveCode can control aspects of an operating system external to itself.
Re: Android Keyboard - Using "Sentence" Option.
Googie85:
Isn't it the case, using the "sentence" idea you mentioned, that only the first character should be capitalized? In other words, if you are creating a document and type a period and then a space, is it that you want the next character to automatically be capitalized? That can be done under script control, and you do not have to change the keyboard. In the script of the field of interest:
Craig
Isn't it the case, using the "sentence" idea you mentioned, that only the first character should be capitalized? In other words, if you are creating a document and type a period and then a space, is it that you want the next character to automatically be capitalized? That can be done under script control, and you do not have to change the keyboard. In the script of the field of interest:
Code: Select all
on rawKeyUp tkey
if char - 3 to - 2 of me is ". " then put toUpper(numToChar(tkey)) into the last char of me
end rawKeyUp
Re: Android Keyboard - Using "Sentence" Option.
All.
I used the "rawKeyUp" message in the above field handler because I cannot detect the "keyUp" message at all. That would be a simpler handler. If I try, I can see "keyDown", no problem. This is in a new stack with a single field. Just me again?
Restarting LC does not help.
Craig
I used the "rawKeyUp" message in the above field handler because I cannot detect the "keyUp" message at all. That would be a simpler handler. If I try, I can see "keyDown", no problem. This is in a new stack with a single field. Just me again?

Restarting LC does not help.
Craig
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Android Keyboard - Using "Sentence" Option.
That WILL capitalise the first letter of all the sentences EXCEPT for the first one.
Re: Android Keyboard - Using "Sentence" Option.
Richmond.
I was making a point, not building the OP's project. So:
Thinking along those lines, one might also allow two or more spaces after the period. And what happens after a hard return? That sort of thing.
And any thoughts on the fact that I can no longer trap "keyUp"?
Craig
I was making a point, not building the OP's project. So:
Code: Select all
on rawKeyUp tkey
if char - 3 to - 2 of me is ". " or the length of me = 1 then
put toUpper(numToChar(tkey)) into the last char of me
end if
end rawKeyUp
And any thoughts on the fact that I can no longer trap "keyUp"?
Craig
Last edited by dunbarx on Thu May 29, 2025 8:18 pm, edited 2 times in total.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Android Keyboard - Using "Sentence" Option.
No.And any thoughts on the fact that I can no longer trap "keyUp"?
I am 'stuck' at 9.6.3.

Re: Android Keyboard - Using "Sentence" Option.
mouseDown and mouseUp make sense, because if you're in mouseDown and the mouse moves out of the target area, mouseUp may have a different effect.dunbarx wrote: ↑Thu May 29, 2025 4:06 pmRichmond.
I was making a point, not building the OP's project. So:And any thoughts on the fact that I can no longer trap "keyUp"?Code: Select all
on rawKeyUp tkey if char - 3 to - 2 of me is ". " or the length of me = 1 then put toUpper(numToChar(tkey)) into the last char of me end if end rawKeyUp
Craig
However, I don't understand why you would want to do this for pressing keys... it's not like a different action may be performed on keyUp.
But in any case, you need to pass the keyDown message to use the keyUp message. This makes your code work:
Code: Select all
on keydown
pass keydown
end keydown
on keyUp pKeyName
if char - 3 to - 2 of me is ". " or the length of me = 1 then
put toUpper(pKeyName) into the last char of me
end if
end keyUp
Re: Android Keyboard - Using "Sentence" Option.
Search for autoCapitalizationType in the dictionary.Googie85 wrote: ↑Thu May 29, 2025 8:08 amI have in the past viewed a way to set the Android keyboard to a "Sentence" option. Essentially when a key is pressed, the character will automatically set the case to uppercase. I have searched the dictionary for "Keyboard" but can't seem to find the information I need.
It's a property of the native android field widget. It seems the widget must be loaded for the entry to show up in the Dictionary.
Code: Select all
set the autoCapitalizationType of widget "Android Field" to "sentences"
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com
Re: Android Keyboard - Using "Sentence" Option.
Stam.
I tried it anyway; it does not work.
But if you have a keyDown handler does it make keyUp work? And if you do not, it does not either? I don't understand this.
All my work is in the field script.
Craig
If I do not have a keyDown handler at all, that message is automatically passed to the engine at every keypress. It never occurred to me that such a thing was (should be) necessary. Explicitly doing so in a handler should do nothing additional.But in any case, you need to pass the keyDown message to use the keyUp message.
I tried it anyway; it does not work.
But if you have a keyDown handler does it make keyUp work? And if you do not, it does not either? I don't understand this.
All my work is in the field script.
Craig
Last edited by dunbarx on Thu May 29, 2025 6:23 pm, edited 1 time in total.
Re: Android Keyboard - Using "Sentence" Option.
Stam.
But it is not I who is concerned with pressing keys, it is the OP. I am not even sure I answered his needs.
Googie85?
My first handler was with "keyUp". But when that failed to even respond I went to "rawKeyUp" along with the deprecated "numTo"Char" function.
Craig
Yes, the mouse can change its environment between mouseDown and mouseUp. That is the reason behind "mouseRelease", to always remember the mouseDown target.mouseDown and mouseUp make sense, because if you're in mouseDown and the mouse moves out of the target area, mouseUp may have a different effect.
However, I don't understand why you would want to do this for pressing keys... it's not like a different action may be performed on keyUp.
But it is not I who is concerned with pressing keys, it is the OP. I am not even sure I answered his needs.
Googie85?
My first handler was with "keyUp". But when that failed to even respond I went to "rawKeyUp" along with the deprecated "numTo"Char" function.
Craig
Re: Android Keyboard - Using "Sentence" Option.
Richmond.
Nobody seems upset at this, so I think I will start a new thread...
Craig
Does that matter? It might, if this is a regression, though I doubt it.I am 'stuck' at 9.6.3.)
Nobody seems upset at this, so I think I will start a new thread...
Craig
Re: Android Keyboard - Using "Sentence" Option.
This isn't a LC thing, it's a keyboard setting. Which keyboard are you using? I use SwiftKey, and the option is in the keyboard settings. Are you using the native Google keyboard?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com