B4A Library [B4X] SD CustomKeyboard

Star-Dust

Expert
Licensed User
Longtime User

Star-Dust

Expert
Licensed User
Longtime User
Hi I think "showkeyboard=true/false" and "visible" not work well. not work after several times
There is no flaw in the library. This method sets the Visible field of the base. Same as you would Keyboard.mBase.Visible = True / False
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
I always get the error

B4X:
 *** MaterialIcons font is missing use this command:
SD_Keyboard1.SpecialKeyFont = xui.CreateMaterialIcons (16)

even if its already added.
 

Star-Dust

Expert
Licensed User
Longtime User
The compiler needs the font and can't find it. The reason is not related to the library but to the code you wrote.
Do the examples work for you?
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
The compiler needs the font and can't find it. The reason is not related to the library but to the code you wrote.
Do the examples work for you?

no, tried sampleA and get the same log output.
Its just an optical thing, it still works.
But I get this message in the log although it should not be. And this comes of course from the libary
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
It's not an error, it's just a warning message to remind you to use this command. Errors are marked in red.
You can ignore it
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
It's not an error, it's just a warning message to remind you to use this command. Errors are marked in red.
You can ignore it
i just want to have a clean log, because i log everything via loccat.
But why it tells me "MaterialIcons font is missing" if its not?
 

Star-Dust

Expert
Licensed User
Longtime User
i just want to have a clean log, because i log everything via loccat.
But why it tells me "MaterialIcons font is missing" if its not?
It is not easy for the library to understand what the assets contain. The method he uses does not always work and therefore if there is a doubt for safety he launches a warning
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
It is not easy for the library to understand what the assets contain. The method he uses does not always work and therefore if there is a doubt for safety he launches a warning
maybe a flag in the lib to deactivate log outputs?
I know these are actually small things, but I am a little perfectionist
 

Star-Dust

Expert
Licensed User
Longtime User
I will see in the next updates if a solution is possible. It definitely won't be a flag to disable logs
 

Star-Dust

Expert
Licensed User
Longtime User
maybe a flag in the lib to deactivate log outputs?
I know these are actually small things, but I am a little perfectionist
SOLVED

Update 1.16
Fixed BUGS that gave false warning for missing MaterialIncons font​
 

Pesciolina

Active Member
Licensed User
Longtime User
Good morning,
I put SD Custom Keyboard library in my project and I get the following error:
if the field is longer than 9 characters, it carries over the previous value and passes to the next field
B4X:
    SD_Keyboard1.SpecialKeyFont=xui.CreateMaterialIcons(22)       
    SD_Keyboard1.keyDel = "׀←"
    SD_Keyboard1.keyEnter = "◄┘"
    
    Dim Ck As CustomKey
    Ck.Initialize
        
    Ck.AddRowSimpleChar(Regex.Split(",","1,2,3"))
    Ck.AddRowSimpleChar(Regex.Split(",","4,5,6"))
    Ck.AddRowSimpleChar(Regex.Split(",","7,8,9"))
    Ck.AddRowSimpleChar(Regex.Split(",","Canc,0,Enter" ))
    
    
    SD_Keyboard1.Add(TxtTempoMan,"TxtTempoMan" ,Ck,TxtNum)
    SD_Keyboard1.Add(TxtNum,"TxtNum" ,Ck,Null)
        
    SD_Keyboard1.LightFactor=1.30
B4X:
Private Sub TxtTempoMan_TextChanged (Old As String, New As String)
    
    
    If TxtTempoMan.Text.Length > 9 Then
        TxtTempoMan.Text = Old
        TxtNum.RequestFocus
        Else
        lblTempoMan.Text = FormattaTempo(New)
    End If

    
End Sub
B4X:
Unexpected event (missing RaiseSynchronousEvents): txttempoman_textchanged
Check the unfiltered logs for the full stack trace.
java.lang.IndexOutOfBoundsException: setSpan (10 ... 10) ends beyond length 0
 

Attachments

  • error.jpg
    87.1 KB · Views: 116

Star-Dust

Expert
Licensed User
Longtime User
It's not a problem with my library. Follow this thread

 

Star-Dust

Expert
Licensed User
Longtime User
That code can cause problems even without the SD_CustomKeyboard. It is not predictable when and how they arise because it depends on many factors related to the execution of the event and the execution speed.

Follow Erel's suggestion he gave in that thread. Use IME.SetLengthFilter
 

Pesciolina

Active Member
Licensed User
Longtime User
I set the following command, as soon as I type the 10th digit I get the error
B4X:
IME.SetLengthFilter(TxtTempoMan, 9)

Private Sub TxtTempoMan_TextChanged (Old As String, New As String)
    
    If New.Length < = 9 Then
        lblTempoMan.Text = FormattaTempo(New)
    End If
    
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
By examining the source I had a more complete picture.
An error was that you change the TextTempoMan when there are still operations in the queue. I entered a sleep.
Also, the change event for TxtNum was missing.

I've attached a working example for you
 

Attachments

  • aSample2.zip
    10.3 KB · Views: 122
Cookies are required to use this site. You must accept them to continue using the site. Learn more…