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

Button Events #48

Open
fbritop opened this issue Jan 24, 2023 · 4 comments
Open

Button Events #48

fbritop opened this issue Jan 24, 2023 · 4 comments

Comments

@fbritop
Copy link

fbritop commented Jan 24, 2023

How can we get our own custom callbacks for buttons as we issued to have with Core2?

` int16_t xx=elem["xx"].as<int16_t>();

      int16_t yy=elem["yy"].as<int16_t>();

      int16_t ww=elem["ww"].as<int16_t>();

      int16_t hh=elem["hh"].as<int16_t>();

      int16_t id=elem["id"].as<int16_t>();

      if(elem["manualOpen"].as<bool>()==true){

        bAcceso = new Button(xx, yy, ww, hh, false, text, onCol, offCol);

        bAcceso->addHandler(eventDisplay, E_RELEASE);

      }else{

        bAcceso = new Button(xx, yy, ww, hh, false, text, onColD, onColD);

      }
      bAcceso->userData=elem["id"].as<int16_t>();`
@lovyan03
Copy link
Collaborator

Hello @fbritop .
Sorry, M5Unified does not currently have that feature.

@fbritop
Copy link
Author

fbritop commented Jan 24, 2023

Unified is actually in?
Alpha
Beta
Prototype

Are we hoping that all M5Core2 and other devices current functions will be ported to Unified?. So to know if we will have to move over Unified sometime in the near future

@lovyan03
Copy link
Collaborator

Hello, @fbritop
Apologies for not including the features you seek.

The main purpose of M5Unified is to absorb the differences between different models and to operate with a common code.
While we would like to provide the same functionality as the existing library as much as possible, it is sometimes difficult to provide it as is.

For example, Support both Arduino and ESP-IDF... Consider how to behave with models that do not have a touch screen...

If you really need it immediately, you can also import the necessary parts from the M5Core2 library and adjust them by yourself.
If M5Unified still seems inadequate, please use M5Core2.h.

@fbritop
Copy link
Author

fbritop commented Jan 25, 2023

Thanks, will stick with that. I just was looking for a simple solution for the speaker problem in Core2.h. Maybe I will seek for Speaker functionality in Unified and try to implement in Core2.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants