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);
|
||||
SubRemViewRemote* subrem_view_remote = context;
|
||||
|
||||
if(event->key == InputKeyBack && event->type == InputTypeLong) {
|
||||
subrem_view_remote->callback(SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
|
||||
return true;
|
||||
} else if(event->key == InputKeyBack && event->type == InputTypeShort) {
|
||||
if(event->key == InputKeyBack && event->type == InputTypePress) {
|
||||
bool is_stopping = false;
|
||||
with_view_model(
|
||||
subrem_view_remote->view,
|
||||
SubRemViewRemoteModel * model,
|
||||
{ model->pressed_btn = 0; },
|
||||
{
|
||||
if(model->state == SubRemViewRemoteStateSending) {
|
||||
is_stopping = true;
|
||||
model->pressed_btn = 0;
|
||||
}
|
||||
},
|
||||
true);
|
||||
subrem_view_remote->callback(
|
||||
SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
|
||||
return true;
|
||||
} else if(event->key == InputKeyBack) {
|
||||
|
||||
//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(
|
||||
SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
|
||||
else
|
||||
subrem_view_remote->callback(
|
||||
SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// BACK button processing end
|
||||
|
||||
if(event->key == InputKeyUp && event->type == InputTypePress) {
|
||||
|
||||
Reference in New Issue
Block a user