You have a condition, that when true you want the keyboard input to be disabled.
Create a variable that holds the condition, lets call it keyboard_disabled.
When you start your animations set keyboard_disabled = True.
When your last animation is completed set keyboard disabled = False
In your normal keyboard handling routines, check is the keyboard is disabled. If keyboard_disabled: then return False, do not process the key press.
If not keyboard_disabled: do your normal key processing.
If you want to disable the TextInput, use the widget attribute “disabled”. If this is the case create a Boolean Kivy property do the processing as described above, and bind the property in kv.
TextInput:
disabled: root.keyboard_disabled
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/13009e17-2bce-48cb-893b-1ae8a46303d1n%40googlegroups.com.
If the question is, “Is there a global attribute to disable all keyboard input?”, I believe you are correct there is no global switch to disable the keyboard input.
I’ve never had a need for this kind of control. In my own apps I have rarely had to bind the keyboard and only use it when looking for special keys (up arrow…). I do often create filters for TextInput widgets. What is the use case that has you looking to disable keyboard input globaly?
I’ll add that if you disable a layout all of it’s children will be disabled.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b34906e1-9746-451c-8c8d-958d73e9133an%40googlegroups.com.
More to facilitate your leaning that to address any problem:
Here is a way to approach creating a global disable. You could use the Widget method walk() to walk over the widget tree. If you wanted, for example to disable all of the Buttons and TextInputs, you could use the python builtin isinstance() to test if a widget is a Button or TextInput and if it is sent the disabled attribute for the widget to True (or False).
To build your multiple selection capability you may want to consider using the Compound Selection Behavior. https://kivy.org/doc/master/api-kivy.uix.behaviors.compoundselection.html
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/61ecb80e-d93d-401d-ba02-4aa1f13ba74fn%40googlegroups.com.