Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lua): deliver EVT_TOUCH_RELEASE event #5587

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wimalopaan
Copy link
Contributor

@wimalopaan wimalopaan commented Oct 3, 2024

first try to solve #5585

Resolves #5585

@wimalopaan
Copy link
Contributor Author

Looks like the LUA constant EVT_TOUCH_RELEASE isn't generated (from keys.h???).

@philmoz
Copy link
Collaborator

philmoz commented Oct 3, 2024

radio/src/lua/api_general.cpp - section starting at line 3194

@wimalopaan
Copy link
Contributor Author

LUA constant EVT_TOUCH_RELEASE added

@pfeerick pfeerick added lua-api Lua API related touch 👆 Related to touch interface labels Oct 6, 2024
@pfeerick pfeerick added this to the 2.11 milestone Oct 6, 2024
@wimalopaan
Copy link
Contributor Author

@pfeerick I think this requires also some minor changes in libGUI ?

@pfeerick
Copy link
Member

@pfeerick pfeerick changed the title Deliver EVT_TOUCH_RELEASE to LUA feat(lua): deliver EVT_TOUCH_RELEASE event Oct 10, 2024
@wimalopaan
Copy link
Contributor Author

Possibly. That will be a seperate PR though - source is here

Ok, I'll make a PR to implement a momentaryButton.

@philmoz
Copy link
Collaborator

philmoz commented Oct 10, 2024

EVENT_TOUCH_RELEASE and _MSK_KEY_RELEASE are not needed.

The existing EVENT_TOUCH_BREAK and _MSK_KEY_BREAK values should be covering the touch release state; but the code is not working.

I suggest removing EVENT_TOUCH_RELEASE and using EVENT_TOUCH_BREAK in the event_cb() function and also delete these non-functional lines from the LuaEventHandler::onClicked() function.

    } else {
      es->event = EVT_TOUCH_BREAK;

@wimalopaan
Copy link
Contributor Author

EVENT_TOUCH_RELEASE and _MSK_KEY_RELEASE are not needed.

The existing EVENT_TOUCH_BREAK and _MSK_KEY_BREAK values should be covering the touch release state; but the code is not working.

I suggest removing EVENT_TOUCH_RELEASE and using EVENT_TOUCH_BREAK in the event_cb() function and also delete these non-functional lines from the LuaEventHandler::onClicked() function.

    } else {
      es->event = EVT_TOUCH_BREAK;

Thanks, I'll have a look at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lua-api Lua API related touch 👆 Related to touch interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propagate TE_RELEASED (touch event) to LUA widgets
3 participants