fix(color): trims may move an extra step when trim key released (#7473)

This commit is contained in:
philmoz
2026-06-30 12:03:24 +10:00
committed by GitHub
parent 1aac6dc4f6
commit 66d9e13199
2 changed files with 2 additions and 11 deletions
+2 -1
View File
@@ -985,7 +985,8 @@ void alert(const char * title, const char * msg , uint8_t sound)
void checkTrims()
{
event_t event = getTrimEvent();
if (event && !IS_KEY_BREAK(event)) {
// Only use press and repeat trim events
if (event && (IS_KEY_FIRST(event) || IS_KEY_REPT(event))) {
int8_t k = EVT_KEY_MASK(event);
uint8_t idx = inputMappingConvertMode(uint8_t(k / 2));
uint8_t phase;
-10
View File
@@ -116,11 +116,6 @@ constexpr bool IS_KEY_EVENT(event_t event)
return (event & 0xF000) == 0; // fired when key is released (short or long), but only if the event was not killed
}
// constexpr bool IS_TRIM_EVENT(event_t event)
// {
// return (IS_KEY_EVENT(event) && EVT_KEY_MASK(event) >= TRM_BASE);
// }
inline bool IS_KEY_FIRST(event_t evt)
{
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_FIRST;
@@ -136,11 +131,6 @@ inline bool IS_KEY_LONG(event_t evt)
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_LONG;
}
inline bool IS_KEY_BREAK(event_t evt)
{
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_BREAK;
}
inline bool IS_KEY_EVT(event_t evt, uint8_t key)
{
return (evt & _MSK_KEY_FLAGS) && (EVT_KEY_MASK(evt) == key);