adafruit / adafruit/Adafruit_CircuitPython_DisplayIO_Layout

`Control` class: Common response function names

Open
#19 24 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13
Forks
16
PR merge metrics
No merged PRs in 30d

Description

With the advent of new widgets such as `icon_widget`, a clear need has arisen for common function naming schemes for the `Control` class. The objective is so that the main event handler can use a common approach for calling multiple widgets to respond to various input events.

Of course, widgets aren't required to conform to any pre-defined response functions, but it will likely make it easier to write a Main loop event handler if widgets have the same function naming and a common expected effect.

----------
Here's one example. Looking at the [PyGUI](https://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/version/Doc/index.html), it defines responses to [four mouse events](https://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/version/Doc/event_handling.html):
- mouse down
- mouse up
- mouse drag (button is pressed)
- mouse move (button is not pressed)

----------
**This issue is raised to gather suggestions for the basic response functions to use in the `Control` class.**

Let's discuss a few basic functions that make sense in a touch environment on small microcontroller screens. The objective is not to collect 100% of cases, but to capture the few things that would be most used, and then grow from there.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Control class context, the icon_widget example, and the linked PyGUI event-handling references in the issue. The work is done when the discussion reaches agreement on a small set of common touch and mouse response function names and their expected effects for the main event handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
design, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.