And if .....?

Star-Dust

Expert
Licensed User
Longtime User
And if I created a customizable keyboard for each EditText (or TextView)?



B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    Private SD_Keyboard1 As SD_Keyboard
    Private TextField1 As EditText
    Private TextField2 As EditText
End Sub

Sub Main
    Dim Ck As CustomKey
    Ck.Initialize
    Ck.AddRowSimpleChar(Regex.Split(",","Q,W,E,R,T,Y,U,I,O,P"))
    Ck.AddRowSimpleChar(Regex.Split(",","A,S,D,F,G,H,J,K,L"))
    Ck.AddRowSimpleChar(Regex.Split(",","Z,X,C,V,B,N,M"))
    
    SD_Keyboard1.Add(TextField1,Ck,"TextField1")
    
    
    Dim Ck As CustomKey
    Ck.Initialize
    Ck.AddRowSimpleChar(Regex.Split(",","1,2,3,4,5,6,7,8,9,0,?"))
    Ck.AddRowSimpleChar(Regex.Split(",","Q,W,E,R,T,Y,U,I,O,P"))
    Ck.AddRowSimpleChar(Regex.Split(",","A,S,D,F,G,H,J,K,L"))
    Ck.AddRowSimpleChar(Regex.Split(",","Z,X,C,V,B,N,M"))
    
    SD_Keyboard1.Add(TextField2,Ck,"TextField2")
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
Quache step forward. Completed for B4A and B4J (for the moment not in b4i) and handles keys like TAB, DEL, CANC, ESC, SHIFT.
It is also possible to set the next focus after concluding with ENTER or NEXT
B4X:
Dim Ck As CustomKey
    Ck.Initialize
    Ck.AddRowSimpleChar(Regex.Split(",","Q,W,E,R,T,Y,U,I,O,P"))
    Ck.AddRowSimpleChar(Regex.Split(",","A,S,D,F,G,H,J,K,L,Canc"))
    Ck.AddRowSimpleChar(Regex.Split(",","Z,X,C,V,B,N,M,Next" ))
 
    SD_Keyboard1.Add(TextField1,"TextField1",Ck,TextField2)
   
    Dim Ck As CustomKey
    Ck.Initialize
    Ck.AddRowSimpleChar(Regex.Split(",","1,2,3,4,5,6,7,8,9,0,?"))
    Ck.AddRowSimpleChar(Regex.Split(",","Q,W,E,R,T,Y,U,I,O,P,Canc" ))
    Ck.AddRowSimpleChar(Regex.Split(",","A,S,D,F,G,H,J,K,L,Del"))
    'Ck.AddRowSimpleChar(Regex.Split(",","Z,X,C,V,B,N,M,Enter"))

    Dim L As List
    L.Initialize
    L.Add(Ck.cKey("Z",90,"z",122))
    l.Add(Ck.cKey("X",90,"x",122))
    L.Add(Ck.cKey("C",67,"c",99))
    l.Add(Ck.cKey("V",86,"v",118))
    l.Add(Ck.cKey("B",66,"b",98))
    l.Add(Ck.cKey("N",78,"n",110))
    L.Add(Ck.cKey("M",77,"m",109))
    l.Add(Ck.cKey("ENTER",13,"enter",13))
    Ck.AddRow(L)

    SD_Keyboard1.Add(TextField2,"TextField2",Ck,TextField1)

It does not absorb the original events but it lifts them anyway
B4X:
Private Sub TextField1_FocusChanged (HasFocus As Boolean)
    Log("Focus1: " & HasFocus)
End Sub
Private Sub TextField2_FocusChanged (HasFocus As Boolean)
    Log("Focus2: " & HasFocus)
End Sub
Private Sub TextField1_EnterPressed
    Log("Enter 1")
End Sub
Private Sub TextField2_EnterPressed
    Log("Enter 2")
End Sub
Private Sub TextField2_TextChanged (Old As String, New As String)
    Log("Change: " & Old & " " & New)
End Sub
 
Last edited:

udg

Expert
Licensed User
Longtime User
I guess that the heart-shaped keys are for Valentine's day

Very nice job. Maybe a more appropriate forum area will be Additonal libraries (even if it's still an ongoing project). Eventually prefix it as [Preview] until ready.
I understand you initial selection for ChitChat was to see how much interest your next lib could beckon..well, now you know it..it's broad ?
 

Sandman

Expert
Licensed User
Longtime User
I'm not criticizing, I'm genuinely curious:

What's the purpose of this keyboard? What problem is it meant to solve instead of the built-in keyboard?
 

Star-Dust

Expert
Licensed User
Longtime User
I'm not criticizing, I'm genuinely curious:

What's the purpose of this keyboard? What problem is it meant to solve instead of the built-in keyboard?
I do not know. I think no real purpose, like several of my libraries, just some graphics.
The most downloaded libraries (at least of mine) are the ones that do nothing but have nice graphics.

Someone was using a 7 year old custom keyboard that conflicted with my library, but only because the custom keyboard was poorly developed.
The person took out my library which I have developed with a lot of work to keep the poorly made keyboard one. This bothered me a lot, I just wanted to show that I could do a better, custom keyboard class with high graphics without bugs in just 2 hours.

I saw the challenge. He solved this problem
 

Star-Dust

Expert
Licensed User
Longtime User
I add that the keyboard on can customize with the IME library.
So you probably don't need other libraries, but for some reason unknown to me others think differently.
I've learned to accept by experiencing customers asking for the strangest things
 

rabbitBUSH

Well-Known Member
Licensed User
Longtime User
I've learned to accept by experiencing customers asking for the strangest things
OMG you're living my life !
What's the purpose of this keyboard? What problem is it meant to solve instead of the built-in keyboard?
I guess I see this sort of idea as similar to the good old days when people wrote code to "pretty-print" code listings in hardcopy to try and make it more readable. In this case it would graphically make keyboards pretty and "attractive" maybe??

the twisted-boy in me also just likes the idea of a customisable keyboard that messes with the users' heads. imagine leaving out all the vowels for instance - rearranging the keys each time one is pressed - the variations are almost endless. jump to a different language board randomly (but hey that would be a nice intentional programmer controlled language option choice - as SD notes above).

????????

pretty printing was apparently non-trivial according to a friend of mine who tried it as a student project.
 

agraham

Expert
Licensed User
Longtime User
You've obviously put a lot of effort into this. What would be nice is a way to hide and show it so it duplicates the appearance and disappearance of the usual keyboard.

Unfortunately I briefly get a flash of the normal IME when focusing on the text field but I guess this is inevitable as you have to close the IME when it Android opens it.
 

Star-Dust

Expert
Licensed User
Longtime User
It depends, sometimes it doesn't even appear yet I still can't understand.
I don't have to put NOEDIT because the cursor disappears, but when I open it I close it immediately.
In very rare cases, the keyboard closes quickly.
It is under development, I have to test it on different devices to understand better
 

Sandman

Expert
Licensed User
Longtime User
A while back I did some research on keyboards and found that it's really a mess. Seems it's one area where Google didn't put a whole lot of effort, so my best guess is that you won't be able to do all that you want. Also consider there are many different keyboards from different companies, with their own quirks. Difficult situation.

Here's the research I did:
 

Star-Dust

Expert
Licensed User
Longtime User
Yes I guess it is a mess, in ios I have other problems I have to build a way to make the cursor appear ....

However, this library is a pastime, as I said it has no particular purpose, if it does not turn out well I will not cry
 

agraham

Expert
Licensed User
Longtime User
A while back I did some research on keyboards and found that it's really a mess.
It certainly is. The keyboard APIs are a badly designed joke. I had endless (and unsuccessful) trouble trying to get an Activity to behave properly when the device was rotated with the keyboard open. Different keybords - different problems, with the keyboard events providing stupidly wrong data and the Activity adopting stupidly wrong sizes - presumably because the IME was giving it bad data.
 

Sandman

Expert
Licensed User
Longtime User
This is probably not overly relevant here, but I stumbled on this post when I just now was searching for something else.
 

Star-Dust

Expert
Licensed User
Longtime User
Thanks I'll watch it
 

Star-Dust

Expert
Licensed User
Longtime User
Here, too, you don't see the blinking cursor. It is important to understand where he writes
 

Star-Dust

Expert
Licensed User
Longtime User
Version for iOs. I thought it should be more difficult than Android, there were several challenges, but it was solved more simply. On android some problems remain



I will release a demo version soon
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…