In events.h there are a bunch of events defined that are used extensively in props files, such as sa22c's button mods. I'm trying to create my own customized button config, but I'm a little confused about a couple of things. For each press of a button, the following events are defined:
1. What is the difference between EVENT_CLICK_SHORT and EVENT_SAVED_CLICK_SHORT? What's special about the latter?
2. I understand that EVENT_HELD corresponds with the value set for BUTTON_HELD_TIMEOUT, and EVENT_HELD_MEDIUM corresponds with the value set for BUTTON_HELD_MEDIUM_TIMEOUT, and so on. But do these events get triggered as soon as the button has been held for the corresponding threshold (i.e, if actions are defined for all three, only EVENT_HELD would trigger), or is the length of time the button has been held only determined after release (in which case the corresponding action is determined by how long the button was held)?
Last Edit: Apr 30, 2021 23:39:44 GMT -5 by caiwyn: Second question was answered in the wiki: https://github.com/profezzorn/ProffieOS/wiki/Button-Actions%3A-making-your-own-prop-file
The saved action is slightly delayed, and does not happen if you do a double/triple/quad-click. EVENT_CLICK_SHORT is not delayed, it happens as at the same time as EVENT_RELEASED, assuming the click wasn't a long one of course.
So is it correct to assume that EVENT_SAVED_CLICK_SHORT occurs 300ms (or whatever value of BUTTON_DOUBLE_CLICK_TIMEOUT) after EVENT_CLICK_SHORT?
Yes, assuming of course another click happens.
You mean assuming it doesn't happen, right?
So here's another question: Suppose I define the following:
case EVENTID(BUTTON_POWER, EVENT_FIRST_CLICK_SHORT, MODE_OFF): On(); return true;
case EVENTID(BUTTON_POWER, EVENT_SECOND_CLICK_SHORT, MODE_OFF): StartOrStopTrack(); return true;
case EVENTID(BUTTON_POWER, EVENT_SAVED_CLICK_SHORT, MODE_ON): SaberBase::DoBlast(); return true;
The idea is that a single click ignites the blade. A double-click ignites the blade *and* starts the music track. Once the saber is on, a single click triggers a blast.
However, turning on the saber changes the mode. So the question is, what actually happens if I double-click while the saber is off? Does the second click start the music track, or (since the first click turns the saber on) does it trigger a blast instead? Or does it do both?
This wouldn't work the way you want to. A double click would not start a track because the saber would be on.
Rats, I was afraid of that. I'm trying to eliminate the 300ms delay from the ignition press, to make it feel more responsive. I'll have to come up with another idea for the Ignite+Music. Maybe hold Aux while pressing Power?
case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_OFF): On(); return true;
case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_OFF | BUTTON_AUX): On(); StartOrStopTrack(); return true;
case EVENTID(BUTTON_POWER, EVENT_CLICK_SHORT, MODE_ON): SaberBase::DoBlast(); return true;
case EVENTID(BUTTON_POWER, EVENT_HELD, MODE_ON): SaberBase::SetLockup(SaberBase::LOCKUP_LIGHTNING_BLOCK); SaberBase::DoBeginLockup(); return true;
case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_ON | BUTTON_AUX): Off(); return true;
Would something like this work? Or would this trigger a Blast when I turned the saber off?
vargose: Verso $45, Sabercore $30, DIYino $30, Golden Harvest $60, Proffie $45, CFX $85. Do you remember when the days when the Crystal focus was $150? Gotta love the sheer availability of options now.
May 17, 2021 9:31:59 GMT -5