Fett263 gesture controls in 5.9 with a single button

Hi all,

I recall that you can use fernando’s gesture controls with SA22Cs 1 button mod but I don’t know how to enable it.

the prop files don’t match the defines so a little help will be great.

1 Like

You need to grab the latest version of the sa22c prop from GitHub.

1 Like

I knew there was custom defines but the prop file in the 5.9 didn’t look right to me. thanks NoSloppy.

I noticed that the MultiPhase isn’t in the SA22C define library.

Now I know it needs the power and aux however I was thinking if I utilised the same key presses that the volume menu does with the twist gestures we could get next preset or previous preset. the other thing we could do is just define next preset and go in a loop rather then back and forward OR COMBINE the long press and twist for next and short press and twist for previous.

looking at the prop file the multiphase looks like this with two buttons but I’m thinking if this will work?
from this original

#ifdef FETT263_MULTI_PHASE
      case EVENTID(BUTTON_NONE, EVENT_TWIST, MODE_ON | BUTTON_AUX):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          next_preset();
          FastOn();
        }
         return true;

      case EVENTID(BUTTON_NONE, EVENT_TWIST, MODE_ON | BUTTON_POWER):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          previous_preset();
          FastOn();
        }
        return true;
#endif

to this,

#ifdef SA22C_MULTI_PHASE
      case EVENTID(BUTTON_NONE, EVENT_TWIST, MODE_ON | BUTTON_PWR):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          next_preset();
          FastOn();
        }
        return true;

 case EVENTID(BUTTON_NONE, EVENT_TWIST, MODE_ON | EVENT_CLICK_SHORT):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          previous_preset();
          FastOn();
        }
        return true;
#endif

Would this mean that twist and 1 second press would go to the next preset and a twist and click would go previous?

EDIT:

FOR posterity and if anyone else wants to try this as well.

#ifdef SA22C_MULTI_PHASE
      case EVENTID(BUTTON_NONE, EVENT_TWIST_LEFT, MODE_ON | BUTTON_POWER):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          next_preset();
          FastOn();
        }
        return true;

 case EVENTID(BUTTON_NONE, EVENT_TWIST_RIGHT, MODE_ON | BUTTON_POWER):
        // Delay twist events to prevent false trigger from over twisting
        if (millis() - last_twist_ > 2000) {
          last_twist_ = millis();
          Off();
          previous_preset();
          FastOn();
        }
        return true;
#endif

This doesn’t work. The modifier needs to be just a button, not an event like you have EVENT_CLICK SHORT.
If you’re looking to do next and prev preset when on, you just need something that’s not already defined.
Also, I think TWIST_RIGHT and TWIST_LEFT are things…

1 Like

where are the eventid listings? I checked the prop file but couldn’t find it.

found it in the wiki prop_base.h FILE. oops it’s in common/events.h

TWIST_CLOSE
TWIST_LEFT
TWIST_RIGHt

now to figure it out. I would assume twist left is right hand moving away from you and twist right is towards.

once I get my saber in hand I’ll test it out.

Thanks Brian.

ProffieOS/common/events.h

1 Like

Yeah I saw that. Very cool.

TWIST_RIGHT and TWIST_LEFT are part of the menu system for OS6. You’ll need the rest of the menu code to run though which is still being finalized.

3 Likes