Re: [kivy-users] disable keyboard for textinput on focus

2,194 views
Skip to first unread message

Gabriel Pettier

unread,
Feb 1, 2013, 7:18:46 AM2/1/13
to kivy-...@googlegroups.com
Hi

I'm not sure i understand, if you want a disabled TextInput, why not use
the `readonly` property of TextInput? Or did i get your question wrong?

http://kivy.org/docs/api-kivy.uix.textinput.html#kivy.uix.textinput.TextInput.readonly


On Thu, Jan 31, 2013 at 04:01:39PM -0800, com...@motaj.com wrote:
> Hi, I've got a TextInput widget and I'd like to disable the keyboard on
> Android upon focussing the widget (so that the user may not enter anythin
> in the widget and also it can get annoying to have to always press the back
> button on the device to hide the keyboard). I've tried the following but it
> doesn't work (the keyboard is still displayed):
>
> In .kv:
>
> TextInput:
> on_focus: root.release_kb()
>
> In .py
> def root.release_kb(self):
> Window.release_all_keyboards()
>
>
> --
> You received this message because you are subscribed to the Google Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

com...@motaj.com

unread,
Feb 1, 2013, 9:09:39 PM2/1/13
to kivy-...@googlegroups.com
Hi,
I've tried readonly but what I want is the keyboard to not display at all when the textinput is focused because my app will have no use for on screen keyboard on Android. With readonly true, the keyboard is still displayed. I've tried
on_focus: focus = False

for the widget which kinds works because it no longer displays the onscreen keyboard on touching the widget but it won't allow me to select or copy its contents (which is a feature I require). Hence it led me to believe that disabling the keyboard is the way to go.

PS: I think I accidentally deleted my first post haha

Gabriel Pettier

unread,
Feb 2, 2013, 8:19:36 AM2/2/13
to kivy-...@googlegroups.com
Oh, i didn't think the keyboard would come up for a readonly textinput
on android, sounds like a bug, and i can reproduce it on my tablet, best
would be to report it on github, so we have at it anyway.
> > an email to kivy-users+...@googlegroups.com <javascript:>.

com...@motaj.com

unread,
Feb 3, 2013, 5:58:52 PM2/3/13
to kivy-...@googlegroups.com
No worries, will report it on github. Cheers
Reply all
Reply to author
Forward
0 new messages