Virtual Keyboard

48 views
Skip to first unread message

Manan Mathur

unread,
Jul 20, 2023, 6:17:44 AM7/20/23
to Kivy users support
I have created a kivy app running on raspberry pi touch display 
Their are 3 input box taking input from VKeyboard 

Problems :
1) when I am switching from one input Box to another input box and typing something the input is typed in both the input box in short previous input box is not getting Unfocused after switching to next input box

2) VKeyboard is not getting closed after used I want Vkeyboard to be closed when I touch on screen elsewhere

If someone can help that will be really helpful thank you

elli...@cox.net

unread,
Jul 21, 2023, 7:17:09 PM7/21/23
to kivy-...@googlegroups.com

Are these issues specific to raspberry pi or do you see the same issues on a touch screen laptop?

 

Share a minimal, runnable example and I’ll take a look.

 

A few other thoughts:

Make sure if you are requesting the keyboard, that you are properly closing it see:  https://kivy.org/doc/stable/api-kivy.core.window.html#kivy.core.window.Keyboard

Read the docs on focus: https://kivy.org/doc/stable/api-kivy.uix.behaviors.focus.html#module-kivy.uix.behaviors.focus

Specifically see:

https://kivy.org/doc/stable/api-kivy.uix.behaviors.focus.html#kivy.uix.behaviors.focus.FocusBehavior.keyboard

https://kivy.org/doc/stable/api-kivy.uix.behaviors.focus.html#kivy.uix.behaviors.focus.FocusBehavior.unfocus_on_touch

--
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/21822d56-33a0-49b9-b192-6e597d2b4ff9n%40googlegroups.com.

ElliotG

unread,
Jul 22, 2023, 1:57:17 PM7/22/23
to Kivy users support
The example below works as you would expect on a Windows 11 laptop with a touch screen using the virtual keyboard.  If this does not work properly on you Raspberry Pi system, it suggests a configuration problem related to the hardware system.  Let me know the behavior you see.

from kivy.config import Config

Config.set('kivy', 'keyboard_mode', 'dock')

from kivy.app import App
from kivy.lang import Builder


kv = """
<FixedWidthTextInput@TextInput>:
size_hint_x: None
width: dp(150)

AnchorLayout:
BoxLayout:
size_hint: None, None
height: dp(30)
width: self.minimum_width
FixedWidthTextInput:
FixedWidthTextInput:
FixedWidthTextInput:
"""

class TextInputsApp(App):
def build(self):
return Builder.load_string(kv)

TextInputsApp().run()

Reply all
Reply to author
Forward
0 new messages