Skip to content

Commit

Permalink
gh 0.0.1 Source Code
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgargallo committed Jun 27, 2023
1 parent 27cdbf3 commit c9e6d0d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
11 changes: 11 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

es: FlipperZero | Guía de definitiva para compilar apps en FlipperZero

## In this new version:

es: En esta nueva versión:

`beta: 3.0.0`

Users can now longpress and shortpress with an indicator on the screen.

es: Los usuarios ahora pueden mantener presionado y presionar brevemente con un indicador en la pantalla.

- [FlipperZero | Ultimate compile guide](#flipperzero--ultimate-compile-guide)
- [In this new version:](#in-this-new-version)
- [Installation](#installation)
- [Create the app](#create-the-app)
- [Code](#code)
Expand Down
2 changes: 1 addition & 1 deletion my_first_app/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ App(
requires=["gui"],
stack_size=1 * 1024,
fap_category="Examples",
)
)
17 changes: 10 additions & 7 deletions my_first_app/my_first_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,29 @@ static void handleInput(InputEvent* input_event, void* context) {
FuriMessageQueue* event_queue = context;
furi_assert(event_queue != NULL);

// Check if the button was long-pressed or not
bool longPress = (input_event->type == InputTypeLong) ? true : false;

// Change the message depending on which key was pressed
switch(input_event->key) {
case InputKeyUp:
message = "You pressed UP!";
message = longPress ? "You long-pressed ^^^" : "You pressed ^";
break;
case InputKeyDown:
message = "You pressed DOWN!";
message = longPress ? "You long-pressed vvv" : "You pressed v";
break;
case InputKeyLeft:
message = "You pressed LEFT!";
message = longPress ? "You long-pressed <<<" : "You pressed <";
break;
case InputKeyRight:
message = "You pressed RIGHT!";
message = longPress ? "You long-pressed >>>" : "You pressed >";
break;
case InputKeyOk:
message = "You pressed CENTER!";
message = longPress ? "You long-pressed ooo" : "You pressed o";
break;
case InputKeyBack:
message = "You pressed BACK!";
exitMessage = "Long press to exit."; // Add this line
message = longPress ? "You long-pressed ---" : "You pressed -";
exitMessage = longPress ? "Exiting the App." : "Long press to exit.";
break;
default:
message = "Press any button...";
Expand Down
Binary file modified other/build/my_first_app.fap
Binary file not shown.

0 comments on commit c9e6d0d

Please sign in to comment.