Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8750133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:48:48+00:00 2026-06-13T12:48:48+00:00

I’ve recently started learning Kivy and using it. Today I’ve come across a problem

  • 0

I’ve recently started learning Kivy and using it. Today I’ve come across a problem that I’m not sure if it’s a bug in Kivy or a misunderstanding from my behalf. This is a simplified version.

I was working on a GUI that has a text input on top for searching. My Kv file looks like this:

#:kivy 1.0
#:import kivy kivy

<SearchPanel>:
    searchquery: searchquery

    AnchorLayout:
        orientation: 'vertical'
        anchor_x: 'center'
        anchor_y: 'top'
        padding: 10

        TextInput:
            id: searchquery
            text: 'What to search for'
            size_hint_x: 0.98
            size_hint_y: None
            height: 30
            on_enter: root.search()

The application code looks like this:

# -*- coding: utf-8 -*-
import kivy
kivy.require('1.4.1')

from kivy.app import App
from kivy.uix.anchorlayout import AnchorLayout


class SearchPanel(AnchorLayout):
    def search(self):
        pass


class ExampleApp(App):
    def build(self):
        return SearchPanel()


if __name__ == '__main__':
    ExampleApp().run()

The problem is that when I run the app I get this traceback:

Traceback (most recent call last):
  File "example.py", line 24, in <module>
    ExampleApp().run()
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/app.py", line 523, in run
    root = self.build()
  File "example.py", line 20, in build
    return SearchPanel()
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/uix/anchorlayout.py", line 62, in __init__
    super(AnchorLayout, self).__init__(**kwargs)
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/uix/layout.py", line 60, in __init__
    super(Layout, self).__init__(**kwargs)
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/uix/widget.py", line 113, in __init__
    Builder.apply(self)
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/lang.py", line 1217, in apply
    self._apply_rule(widget, rule, rule)
  File "/home/testing/.virtualenvs/kivy2/local/lib/python2.7/site-packages/Kivy-1.4.1-py2.7-linux-x86_64.egg/kivy/lang.py", line 1346, in _apply_rule
    crule, idmap)})
  File "_event.pyx", line 184, in kivy._event.EventDispatcher.bind (/tmp/easy_install-PMy51_/Kivy-1.4.1/kivy/_event.c:2038)
KeyError: 'enter'

Apparently I cannot plug in on_enter callback to the root layout, what am I doing wrong? If I change on_enter with on_text it works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:48:49+00:00Added an answer on June 13, 2026 at 12:48 pm

    Ok, I figured out that on_enter is not a TextInput event.

    Instead you need to use on_text_validate which only works with monoline text inputs. Or you can bind your widget’s on_text_validate to an on_enter function or method if you prefer it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.