Skip to content

Commit

Permalink
Support RETURN and ENTER keys
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoparrilla committed Oct 25, 2023
1 parent 2afb791 commit 262203f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion configurator/src/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int display_paginated_content(char *file_array, int num_files, int page_size, ch
int current_index = 0;
locate(0, 22);
printf("Use [UP] and [DOWN] arrows to select. [LEFT] and [RIGHT] to paginate.\r\n");
printf("Press [ENTER] to load it. [ESC] to return to main menu.");
printf("Press [ENTER] or [RETURN] to load. [ESC] to return to main menu.");

while (selected_rom < 0)
{
Expand Down Expand Up @@ -437,6 +437,7 @@ int display_paginated_content(char *file_array, int num_files, int page_size, ch
}
break;
case KEY_ENTER:
case KEY_RETURN:
selected_rom = current_index + 1;
return selected_rom;
case KEY_ESC:
Expand Down
3 changes: 2 additions & 1 deletion configurator/src/include/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static __uint32_t random_number = 0x0;
#define KEY_DOWN_ARROW 0x500000
#define KEY_LEFT_ARROW 0x4B0000
#define KEY_RIGHT_ARROW 0x4D0000
#define KEY_ENTER 0x1C000D
#define KEY_RETURN 0x1C000D
#define KEY_ENTER 0x72000D
#define KEY_ESC 0x1001B

#define PRINT_APP_HEADER(version) \
Expand Down

0 comments on commit 262203f

Please sign in to comment.