mirror of
https://protopirate.net/ProtoPirate/ProtoPirate.git
synced 2026-10-23 13:42:21 +00:00
Refactor lock count handling in protopirate_receiver
This commit is contained in:
1 parent
f78c153383
commit
ff2acb36d5
1 file changed
+11
-9
@@ -363,17 +363,19 @@ bool protopirate_view_receiver_input(InputEvent* event, void* context) {
|
||||
receiver->view,
|
||||
ProtoPirateReceiverModel * model,
|
||||
{
|
||||
if(event->type == InputTypeShort && event->key == InputKeyBack) {
|
||||
model->lock_count++;
|
||||
if(model->lock_count >= UNLOCK_CNT) {
|
||||
model->lock = ProtoPirateLockOff;
|
||||
model->lock_count = 0;
|
||||
if(receiver->callback) {
|
||||
receiver->callback(
|
||||
ProtoPirateCustomEventViewReceiverUnlock, receiver->context);
|
||||
if(event->key == InputKeyBack) {
|
||||
if(event->type == InputTypeShort) {
|
||||
model->lock_count++;
|
||||
if(model->lock_count >= UNLOCK_CNT) {
|
||||
model->lock = ProtoPirateLockOff;
|
||||
model->lock_count = 0;
|
||||
if(receiver->callback) {
|
||||
receiver->callback(
|
||||
ProtoPirateCustomEventViewReceiverUnlock, receiver->context);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if(event->type == InputTypeShort || event->type == InputTypeLong || event->type == InputTypePress) {
|
||||
model->lock_count = 0;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user