Android Question Is there a way to disable softkeyboard, while in the app?

mare1980k1

Member
Licensed User
Longtime User
I have textbox that I need to use with the custom keyboard I made using bunch of buttons and a panel. So I need the option to see the cursor in the text view - so I cant use the input_type to none. I can't disable softkeyboard except to make it not visible when someone clicks on the textbox, but it's not the solution cause it doesn't register the click on the first click to hide the soft key using ime.hidekeyboard.. and it shows the standard keyboard instead of showing my custom keyboard so I cant use that event like that. Again is there a way to disable it maybe in manifest editor in some way?
Thanks a lot :)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Check this example for a nice custom keyboard: https://www.b4x.com/android/forum/threads/customview-numpad.64191/#content
(there is no cursor in that example)

You can try something like:
B4X:
Sub EditText_FocusChanged (HasFocus As Boolean)
   If HasFocus Then
       Sleep(20)
       ime.HideKeyboard
   End If
End Sub

Sub EditText_Click
   Sleep(20)
   ime.HideKeyboard
End Sub
It does work here.
 
Upvote 0

mare1980k1

Member
Licensed User
Longtime User
Perfect Erel, thanks :) I have implemented almost the same solution as you mentioned, only part that I added was to request focus to the edittext on activity start. Again thanks for the quick response :) It works now as expected.
 
Upvote 0
Top