mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
Change back button exit to short press (or stop transmission if one active. Brings behaviour into lie with other apps.
This commit is contained in:
@@ -201,21 +201,30 @@ bool subrem_view_remote_input(InputEvent* event, void* context) {
|
|||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
SubRemViewRemote* subrem_view_remote = context;
|
SubRemViewRemote* subrem_view_remote = context;
|
||||||
|
|
||||||
if(event->key == InputKeyBack && event->type == InputTypeLong) {
|
if(event->key == InputKeyBack && event->type == InputTypePress) {
|
||||||
subrem_view_remote->callback(SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
|
bool is_stopping = false;
|
||||||
return true;
|
|
||||||
} else if(event->key == InputKeyBack && event->type == InputTypeShort) {
|
|
||||||
with_view_model(
|
with_view_model(
|
||||||
subrem_view_remote->view,
|
subrem_view_remote->view,
|
||||||
SubRemViewRemoteModel * model,
|
SubRemViewRemoteModel * model,
|
||||||
{ model->pressed_btn = 0; },
|
{
|
||||||
|
if(model->state == SubRemViewRemoteStateSending) {
|
||||||
|
is_stopping = true;
|
||||||
|
model->pressed_btn = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
//Cant send exit the app inside that with_model,locks the model and the app will hang and not unload!
|
||||||
|
if(is_stopping)
|
||||||
subrem_view_remote->callback(
|
subrem_view_remote->callback(
|
||||||
SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
|
SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
|
||||||
return true;
|
else
|
||||||
} else if(event->key == InputKeyBack) {
|
subrem_view_remote->callback(
|
||||||
|
SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BACK button processing end
|
// BACK button processing end
|
||||||
|
|
||||||
if(event->key == InputKeyUp && event->type == InputTypePress) {
|
if(event->key == InputKeyUp && event->type == InputTypePress) {
|
||||||
|
|||||||
Reference in New Issue
Block a user