Components: refactor Button input handling#1271
Conversation
remove the old onlyOnPress Button property. When set to false, this would toggle the value of a Control on button up and button down, which is not really the correct behavior. Instead, let Buttons have a type, with the default type being push. The button types are: push: set inKey to 1 on button press and 0 on button release toggle: toggle value of inKey on button press trigger: set inKey to 1 on button press powerWindow: like toggle, but toggles the value of inKey again on button up when long pressed The ComponentContainer.shift() and ComponentContainer.unshift() functions automatically take care of setting the inKey of push type Buttons to 0 on shift/unshift to ensure that it does not matter whether shift or the Button is released first.
that have specialized input functions instead of the prototype Button input function
|
I can test this next days. |
That has already been the case since #1249 was merged. The EffectUnit API has not changed, neither has its behavior. I'm looking for feedback on the changes to the Button API. |
I do not think there is a use case for it. Controls that only do something when set to 1 still need to be reset to 0 or their button in the skin will remain on after releasing the controller Button.
remove log spam from killing expired timers
|
Can we think of a better name than powerWindow? toggleHold? |
Woohoo, wasn't aware of that PR. Thanks! |
|
@ronso0 can we merge this now? |
|
@daschuer Sorry, I can't tell...as I said I use Components for effects only, don't know what difference it makes for a complete Components mapping |
|
Ok, than I think we can merge this, and fix pending issues in master if
there are any. Right?
Am 31.05.2017 3:11 vorm. schrieb "ronso0" <notifications@github.com>:
@daschuer <https://github.com/daschuer> Sorry, I can't tell...as I said I
use Components for effects only, don't know what difference it makes for a
complete Components mapping
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1271 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABsfInp35O4xJyaxlDwk2obpJCQa7kzaks5r_L47gaJpZM4No0e9>
.
|
|
Ok, Thank you for your work. |
Remove the old onlyOnPress Button property. When set to false, this would toggle the value of a Control on button up and button down, which is not really the correct behavior. Instead, let Buttons have a type, with the default type being push. The button types are:
The ComponentContainer.shift() and ComponentContainer.unshift() functions automatically take care of setting the inKey of push type Buttons to 0 on shift/unshift to ensure that it does not matter whether shift or the Button is released first. Before this required some ugly hacks that would have to be implemented by each Button.
This is a backwards incompatible change. Previously, the default was to set the onlyOnPress property to
true, equivalent to the new toggle type. Buttons that had onlyOnPress set tofalsebefore can simply remove that and use the default push type. All the special Buttons implemented in the library such as HotcueButton and the Buttons for the EffectUnit have been updated appropriately. I'll update #1200 and #1243 for the new API.