Saltar al contenido

Lista de todos los eventos de Tkinter

Puede que se de el caso de que encuentres algún problema con tu código o trabajo, recuerda probar siempre en un entorno de testing antes aplicar el código al trabajo final.

Solución:

Se puede encontrar una lista general de enlaces y eventos en effbot.org o en los documentos proporcionados por New Mexico Tech, mientras que el nombre de varios keys se enumeran aquí además de la documentación original.

Aquí hay un resumen de los eventos más comunes con algunos nombres de pulsaciones de teclas explicados:

        Button 1 is the leftmost button, button 2 is the middle button
                  (where available), and button 3 the rightmost button.

                  , , and <1> are all synonyms.

                  For mouse wheel support under Linux, use Button-4 (scroll
                  up) and Button-5 (scroll down)

       The mouse is moved, with mouse button 1 being held down (use
                  B2 for the middle button, B3 for the right button).

 Button 1 was released. This is probably a better choice in
                  most cases than the Button event, because if the user
                  accidentally presses the button, they can move the mouse
                  off the widget to avoid setting off the event.

 Button 1 was double clicked. You can use Double or Triple as
                  prefixes.

           The mouse pointer entered the widget (this event doesn’t mean
                  that the user pressed the Enter key!).

           The mouse pointer left the widget.

         Keyboard focus was moved to this widget, or to a child of
                  this widget.

        Keyboard focus was moved from this widget to another widget.

          The user pressed the Enter key. For an ordinary 102-key
                  PC-style keyboard, the special keys are Cancel (the Break
                  key), BackSpace, Tab, Return(the Enter key), Shift_L (any
                  Shift key), Control_L (any Control key), Alt_L (any Alt key),
                  Pause, Caps_Lock, Escape, Prior (Page Up), Next (Page Down),
                  End, Home, Left, Up, Right, Down, Print, Insert, Delete, F1,
                  F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Num_Lock, and
                  Scroll_Lock.

             The user pressed any key. The key is provided in the char
                  member of the event object passed to the callback (this is an
                  empty string for special keys).

a                 The user typed an “a”. Most printable characters can be used
                  as is. The exceptions are space () and less than
                  (). Note that 1 is a keyboard binding, while <1> is a
                  button binding.

        The user pressed the Up arrow, while holding the Shift key
                  pressed. You can use prefixes like Alt, Shift, and Control.

       The widget changed size (or location, on some platforms). The
                  new size is provided in the width and height attributes of
                  the event object passed to the callback.

        A widget is changing from being inactive to being active.
                  This refers to changes in the state option of a widget such
                  as a button changing from inactive (grayed out) to active.


      A widget is changing from being active to being inactive.
                  This refers to changes in the state option of a widget such
                  as a radiobutton changing from active to inactive (grayed out).

         A widget is being destroyed.

          This event occurs whenever at least some part of your
                  application or widget becomes visible after having been
                  covered up by another window.

      The user let up on a key.

             A widget is being mapped, that is, made visible in the
                  application. This will happen, for example, when you call the
                  widget's .grid() method.

          The user moved the mouse pointer entirely within a widget.

      The user moved the mouse wheel up or down. At present, this
                  binding works on Windows and MacOS, but not under Linux.

           A widget is being unmapped and is no longer visible.

      Happens when at least some part of the application window
                  becomes visible on the screen.

Intente mirar la definición de class EventType en el código fuente del módulo tkinter/__init__.py.

Por lo general, para mí, estos módulos se muestran como una pestaña en mi IDE de Wing si ocurre una excepción.

Aquí tienes las reseñas y calificaciones

¡Haz clic para puntuar esta entrada!
(Votos: 3 Promedio: 3.7)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *