Key Listeners

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    Key Listeners

    Are there key listeners for Python? Either built in or third party?

  • kaens

    #2
    Re: Key Listeners

    On 29 May 2007 19:14:33 -0700, Mike <wockehful@gmai l.comwrote:
    Are there key listeners for Python? Either built in or third party?
    >
    --

    >
    I'm pretty sure pygame's got some, don't know about built-ins.

    Comment

    • Gary Herron

      #3
      Re: Key Listeners

      Mike wrote:
      Are there key listeners for Python? Either built in or third party?
      >
      >
      (As always on forums like this, you're most likely to get answers if you
      define your terms. A little Goggling informs me that in Java a key
      listener is a Java term for a component that generates an event when the
      keyboard is used. )

      Yes, every GUI I've ever used from Python (Tk/Tcl, wxPython, Gtk++,
      Win32 API, ...) has a way to catch keyboard events. But you're going to
      have to tell us which OS and which GUI you're interested in before you
      get a more detailed answer.

      Gary Herron

      Comment

      • bruno.desthuilliers@gmail.com

        #4
        Re: Key Listeners

        On 30 mai, 04:14, Mike <wockeh...@gmai l.comwrote:
        Are there key listeners for Python? Either built in or third party?
        What is a "key listener" ?

        Comment

        • Benedict Verheyen

          #5
          Re: Key Listeners

          bruno.desthuill iers@gmail.com schreef:
          On 30 mai, 04:14, Mike <wockeh...@gmai l.comwrote:
          >Are there key listeners for Python? Either built in or third party?
          >
          What is a "key listener" ?
          >
          I thought it was a rather straightforward name.
          Something that listens for a key. In other words, a piece of software
          that detects what keys are being tapped.
          In google, the first link is a link to the java sun home page.
          The first sentence on that page: "Key events indicate when the user is
          typing at the keyboard."

          Regards,
          Benedict

          Comment

          • Bruno Desthuilliers

            #6
            Re: Key Listeners

            Benedict Verheyen a écrit :
            bruno.desthuill iers@gmail.com schreef:
            >On 30 mai, 04:14, Mike <wockeh...@gmai l.comwrote:
            >>Are there key listeners for Python? Either built in or third party?
            >>
            >What is a "key listener" ?
            >>
            (snip)
            In google, the first link is a link to the java sun home page.
            The first sentence on that page: "Key events indicate when the user is
            typing at the keyboard."
            I do know what's a "key listener" in Java, thanks !-)

            My question was supposed to have side effects - like the OP asking
            himself if he was really asking the right question.

            Regards too.

            Comment

            • kaens

              #7
              Re: Key Listeners

              On 5/30/07, Bruno Desthuilliers
              <bruno.42.desth uilliers@wtf.we bsiteburo.oops. comwrote:
              Benedict Verheyen a écrit :
              bruno.desthuill iers@gmail.com schreef:
              On 30 mai, 04:14, Mike <wockeh...@gmai l.comwrote:
              >Are there key listeners for Python? Either built in or third party?
              >
              What is a "key listener" ?
              >
              (snip)
              In google, the first link is a link to the java sun home page.
              The first sentence on that page: "Key events indicate when the user is
              typing at the keyboard."
              >
              I do know what's a "key listener" in Java, thanks !-)
              >
              My question was supposed to have side effects - like the OP asking
              himself if he was really asking the right question.
              >
              Regards too.
              --

              >
              What, he wants to know if there's a way in python to capture
              keystrokes, and do something with them depending on what they are.

              I mean, it's very unlikely that you would ask for something called a
              "key listener" if you didn't want to do something like:

              if keypress == 'a':
              do somem

              right? Even if you're looking to do it the java way, all of the
              listener functionality more or less boils down to "wait for and report
              keys being pressed".

              He could have been less ambiguous, but I don't think that he was
              asking the wrong question per se.

              Not to mention asking the OP "what's a key listener" isn't going to
              make them think about the question they asked - it makes it seem like
              you don't know what a key listener is (and frankly, I think that if
              you have done any work with doing stuff on different keystrokes,
              you'll figure out what is meant by key listener pretty quickly, even
              if you haven't heard the term before)

              Comment

              • momobear

                #8
                Re: Key Listeners

                On May 30, 10:14 am, Mike <wockeh...@gmai l.comwrote:
                Are there key listeners for Python? Either built in or third party?
                try "pykeylogge r", that's maybe u want.

                Comment

                • Bruno Desthuilliers

                  #9
                  Re: Key Listeners

                  kaens a écrit :
                  On 5/30/07, Bruno Desthuilliers
                  <bruno.42.desth uilliers@wtf.we bsiteburo.oops. comwrote:
                  >Benedict Verheyen a écrit :
                  bruno.desthuill iers@gmail.com schreef:
                  >On 30 mai, 04:14, Mike <wockeh...@gmai l.comwrote:
                  >>Are there key listeners for Python? Either built in or third party?
                  >>
                  >What is a "key listener" ?
                  >>
                  >(snip)
                  In google, the first link is a link to the java sun home page.
                  The first sentence on that page: "Key events indicate when the user is
                  typing at the keyboard."
                  >>
                  >I do know what's a "key listener" in Java, thanks !-)
                  >>
                  >My question was supposed to have side effects - like the OP asking
                  >himself if he was really asking the right question.
                  >>
                  >Regards too.
                  >--
                  >http://mail.python.org/mailman/listinfo/python-list
                  >>
                  >
                  What, he wants to know if there's a way in python to capture
                  keystrokes, and do something with them depending on what they are.
                  Which would have been a much better way to express the question.
                  I mean, it's very unlikely that you would ask for something called a
                  "key listener" if you didn't want to do something like:
                  >
                  if keypress == 'a':
                  do somem
                  >
                  right?
                  Wrong. *You* can deduce this from the OP question because you know Java
                  (and more exactly : GUI programming in Java).

                  As far as I'm concerned, a 'key listener' could be something observing
                  adding/deletion of key/value couples in a dict !-)
                  Not to mention asking the OP "what's a key listener" isn't going to
                  make them think about the question they asked - it makes it seem like
                  you don't know what a key listener is
                  Exactly. Which may lead the OP to the conclusion that not everybody
                  knows Java GUI programming, and that it may be better to ask in more
                  general terms...

                  Also, and FWIW, there are words that name very different concepts in
                  different languages. And I don't know each and every concept of each and
                  every language in the world (perhaps you do ?). So, just because I know
                  what name X means in langage Y doesn't necessarily imply the OP isn't
                  thinking of what it means in langage ZZ...

                  Comment

                  • Benedict Verheyen

                    #10
                    Re: Key Listeners

                    kaens schreef:
                    <snip>
                    >>
                    >
                    What, he wants to know if there's a way in python to capture
                    keystrokes, and do something with them depending on what they are.
                    >
                    I mean, it's very unlikely that you would ask for something called a
                    "key listener" if you didn't want to do something like:
                    >
                    if keypress == 'a':
                    do somem
                    >
                    right? Even if you're looking to do it the java way, all of the
                    listener functionality more or less boils down to "wait for and report
                    keys being pressed".
                    >
                    He could have been less ambiguous, but I don't think that he was
                    asking the wrong question per se.
                    >
                    Not to mention asking the OP "what's a key listener" isn't going to
                    make them think about the question they asked - it makes it seem like
                    you don't know what a key listener is (and frankly, I think that if
                    you have done any work with doing stuff on different keystrokes,
                    you'll figure out what is meant by key listener pretty quickly, even
                    if you haven't heard the term before)
                    That's how it came across for me too. Couldn't have said it better kaens.

                    Benedict

                    Comment

                    Working...