Skip to content

Using only 3 buttons - modifying button actions #94

Closed Answered by Spirik
Prithul0218 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there!

In order to override default behavior of key presses you have to pass key codes to menu.registerKeyPress() method explicitly as described in Control menu from your sketch section of wiki. You may want to do that based on the value of _editValueMode flag that you've made public (btw, preferred way to do that w/o modification of source code is as described in Inherit classes section of wiki). Also be aware of selects, as they behavior should be left as is.

So very roughly it may look something like this (not tested!):

// Make protected fields accessible through custom getter methods
class GEMProxy : public GEM_u8g2 {
  public:
    using GEM_u8g2::GEM_u8g2;

    // Make _editValueM…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Spirik
Comment options

Answer selected by Prithul0218
@Prithul0218
Comment options

@Spirik
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants