Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Enable backlight with input keyboard command
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Aug 13, 2023
1 parent bbcacd1 commit 88e54a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/services/input/input_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <gui/view_port_i.h>
#include <gui/view_dispatcher_i.h>
#include <gui/modules/text_input_i.h>
#include <notification/notification_messages.h>

static void input_cli_usage() {
printf("Usage:\r\n");
Expand Down Expand Up @@ -48,6 +49,7 @@ static void input_cli_dump(Cli* cli, FuriString* args, Input* input) {
static void input_cli_keyboard(Cli* cli, FuriString* args, Input* input) {
UNUSED(args);
Gui* gui = furi_record_open(RECORD_GUI);
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);

printf("Using console keyboard feedback for flipper input\r\n");

Expand Down Expand Up @@ -82,6 +84,7 @@ static void input_cli_keyboard(Cli* cli, FuriString* args, Input* input) {
if(in_chr == 0x11) { // Ctrl Q = Close text input
send_key = InputKeyBack;
} else if(text_input_insert_character(text_input, in_chr)) {
notification_message(notification, &sequence_display_backlight_on);
continue;
}
}
Expand Down Expand Up @@ -115,12 +118,14 @@ static void input_cli_keyboard(Cli* cli, FuriString* args, Input* input) {
}

if(send_key != InputKeyMAX) {
notification_message(notification, &sequence_display_backlight_on);
input_fake_event(input, send_key, hold ? InputTypeLong : InputTypeShort);
hold = false;
}
}

furi_record_close(RECORD_GUI);
furi_record_close(RECORD_NOTIFICATION);
}

static void input_cli_send_print_usage() {
Expand Down

0 comments on commit 88e54a8

Please sign in to comment.