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

  • Home
  • SEARCH
  • 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 8707365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:51:13+00:00 2026-06-13T03:51:13+00:00

This simple application almost does what I want: import Tkinter as Tk def hello(x):

  • 0

This simple application almost does what I want:

import Tkinter as Tk

def hello(x):
    print "Hello"

root = Tk.Tk()
root.bind("<Up>", hello)
root.mainloop()

I mash down the up arrow, it prints “Hello” over and over. However, there is a delay before this repetition begins, and the repetition rate is slower than I want. How can I set this repeat delay to zero? How can I control the repeat interval?

I know that other Tkinter widgets have configuration options for ‘repeatdelay’ and ‘repeatinterval’, but I can’t seem to find one for a Tkinter root window.

(I’m looking in your direction, Bryan Oakley)

  • 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-13T03:51:15+00:00Added an answer on June 13, 2026 at 3:51 am

    This is not something configurable in Tk — Tk has no control over how fast the keyboard driver sends repeated key events.

    What you can do instead is have a binding on the button press and button release to set and then unset a flag. Then, you can write a function that does whatever you want it to do, then check the flag and call itself again after whatever delay you want.

    The function would look something like this:

    def hello(x):
        global SHOULD_REPEAT
        print "hello"
        if SHOULD_REPEAT:
            root.after(10, hello) # wait 10ms then repeat
    

    To do it right requires a little bit more logic, but that’s the general idea.

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

Sidebar

Related Questions

I want to build a simple application with the MVVM pattern. This application will
I am trying to create this simple application in c#: when the user double
For a simple chat application, I thought of using this simple layout: *----------------------------------* |<div>
I have this simple code in a WPF application: ThreadStart start = delegate() {
I created a simple application inspired by this example in order to test all
I'm following this example for creating a simple Web application using JAX-RS, MongoDB and
I have a simple WPF application that uses ClickOnce to handle installing. Within this
Been thinking about this for hours now. Im building a simple slideshow application, where
This will be simple for you guys: var uri = new Uri(pack://application:,,,/LiftExperiment;component/pics/outside/elevator.jpg); imageBitmap =
I am designing a simple web-based application. I am new to this web-based domain.I

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.