Event types
GooeyPie supports a variety of events that can be triggered by user interactions with widgets. Here is the list of events you can use in your GooeyPie apps:
| Method | Description |
|---|---|
| Mouse buttons | |
.on_click(event_function) | Called when the user clicks the widget with the primary mouse button. |
.on_double_click(event_function) | Called when the user rapidly clicks the widget twice in succession. |
.on_right_click(event_function) | Called when the user clicks the widget with the right mouse button. |
.on_middle_click(event_function) | Called when the user clicks the widget with the middle mouse button (or scroll wheel). |
.on_mouse_down(event_function) | Called the moment the primary mouse button is pressed down over the widget. |
.on_mouse_up(event_function) | Called the moment the primary mouse button is released over the widget. |
| Mouse movement | |
.on_mouse_enter(event_function) | Called when the mouse cursor moves into the widget’s area. |
.on_mouse_leave(event_function) | Called when the mouse cursor moves out of the widget’s area. |
| Keyboard | |
.on_key_press(event_function) | Called when the user presses a key while the widget is focused. |
| Focus | |
.on_focus_gained(event_function) | Called when the widget becomes the currently selected element on the screen, ready to receive keyboard interaction. Note: not all widgets are capable of receiving focus. |
.on_focus_lost(event_function) | Called when the widget is no longer the active target for keyboard input. |
| Value | |
.on_change(event_function) | Available on the following widgets:
|