Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92189

Re: Keypress Input

From Laura Creighton <lac@openend.se>
Subject Re: Keypress Input
References <rBHbx.75089$MO7.40532@fx10.iad><hZGcx.45402$LN4.24632@fx02.iad>
Date 2015-06-06 22:52 +0200
Newsgroups comp.lang.python
Message-ID <mailman.220.1433623981.13271.python-list@python.org> (permalink)

Show all headers | View raw


In a message of Sat, 06 Jun 2015 18:28:29 +0000, John McKenzie writes:
>
>
> Laura and Gary, thank you for your replies. I have three physical 
>buttons connected to a Kade device emulating a keyboard. These buttons 
>control an LED light strip. So there is no screen, so a GUI did not cross 
>my mind. I thought it made sense as it is easily done by other scripting 
>languages. Thank you both for pointing my in the right direction.
>
> It turns out Tkinter is installed on Raspian and my Pi has it. Typing 
>import tkinter into the Python interpreter gave me an error, then I 
>corrected my spelling. The T should be upper case. No errors with "import 
>Tkinter".
>
> Laura, thank you for typing up example code. I had to remove one indent 
>on line 9, but after that it worked on my desktop. The Pi gave an error 
>about Tkinter when I tried to run your code but I will work on that. In 
>the meantime I will work my basic code out on the desktop and then move 
>it over to the Pi, adapting it for and fixing Pi issues then.
>
> In my mind the Tkinter information I read on the web contradicts the 
>examples given with the text, so obviously I am not getting it at all. 
>Tkinter seems very confusing to me right now, but I think I just need to 
>review the conceptual stuff again and keep trying. Also, I have your 
>example, which I can experiment with.
> 
>
> Thanks.

You are most welcome.  Sorry if I mangled the indent when pasting it
into my mail.

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html
is useful.
Especially http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/key-names.html

So is http://effbot.org/tkinterbook/

Write back if you run into trouble.  The simple code I sent is just about
binding every key press to something that announces what you pressed.
You will have to bind particular keys, or sequence of keys to what
you want to do.  Write a small example to make sure that tkinter can
talk to your Kade device ok, because if it cannot we will have to
look harder at the problem.

Laura

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-03 18:22 +0000
  Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-03 20:59 +0200
  Re: Keypress Input Gary Herron <gherron@digipen.edu> - 2015-06-03 12:15 -0700
  Re: Keypress Input Gary Herron <gherron@digipen.edu> - 2015-06-03 11:47 -0700
  Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-04 12:50 +0200
  Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-06 18:28 +0000
    Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-06 22:52 +0200
    Re: Keypress Input Chris Angelico <rosuav@gmail.com> - 2015-06-07 07:20 +1000
    Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-06 22:31 -0600
  Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-15 05:15 +0000
    Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-16 15:09 +0000
    Re: Keypress Input Christian Gollwitzer <auriocus@gmx.de> - 2015-06-19 07:20 +0200
      Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-20 14:59 +0000
      Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-15 18:03 -0700
        Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-15 22:30 -0600
          Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 10:22 -0700
            Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-16 15:27 -0600
        Re: Keypress Input Terry Reedy <tjreedy@udel.edu> - 2015-07-16 02:08 -0400
          Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 11:30 -0700
        Re: Keypress Input Terry Reedy <tjreedy@udel.edu> - 2015-07-16 03:10 -0400
        Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-16 15:29 -0600
  Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-15 05:23 +0000
    Re: Keypress Input Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-06-15 12:22 +0100
      Re: Keypress Input Grant Edwards <invalid@invalid.invalid> - 2015-06-15 15:22 +0000
    Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-16 11:15 -0600
      Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-16 20:06 +0000
        Re: Keypress Input Grant Edwards <invalid@invalid.invalid> - 2015-06-16 20:49 +0000
          Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-16 19:22 -0600
          Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-18 16:42 -0600
      Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-20 15:02 +0000
        Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-20 10:30 -0600
  Re: Keypress Input Paul Rubin <no.email@nospam.invalid> - 2015-06-16 14:22 -0700
  Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-07-15 19:05 +0000
    Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-15 13:17 -0600
      Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-08-16 19:45 +0000

csiph-web