From 582604665a56a22fc5ac8e6946db4b7d261cda92 Mon Sep 17 00:00:00 2001 From: Cort <1944792+cdwfs@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:38:30 -0700 Subject: [PATCH 1/3] Add me to contributor list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 371fe97d1..c19b01b0d 100644 --- a/README.md +++ b/README.md @@ -258,3 +258,4 @@ You can find iOS/tvOS version here * David St-Hilaire - [GitHub @sthilaid](https://github.com/sthilaid) * Alec Troemel - [Github @alectroemel](https://github.com/AlecTroemel) * Kolten Pearson - [Github @koltenpearson](https://github.com/koltenpearson) +* Cort Stratton - [Github @cdwfs](https://github.com/cdwfs) From 2600b8f4588f63a6625770718873771036201ec6 Mon Sep 17 00:00:00 2001 From: Cort <1944792+cdwfs@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:59:18 -0700 Subject: [PATCH 2/3] Add ESC, function keys, and numpad keys to "help keys" table --- src/studio/screens/console.c | 46 ++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/src/studio/screens/console.c b/src/studio/screens/console.c index db015d50b..3369abf57 100644 --- a/src/studio/screens/console.c +++ b/src/studio/screens/console.c @@ -3143,15 +3143,51 @@ static s32 createKeysTable(char* buf) {63, "CTRL"}, {64, "SHIFT"}, {65, "ALT"}, + {66, "ESC"}, + {67, "F1"}, + {68, "F2"}, + {69, "F3"}, + {70, "F4"}, + {71, "F5"}, + {72, "F6"}, + {73, "F7"}, + {74, "F8"}, + {75, "F9"}, + {76, "F10"}, + {77, "F11"}, + {78, "F12"}, + {78, "NUM0"}, + {79, "NUM1"}, + {80, "NUM2"}, + {81, "NUM3"}, + {82, "NUM4"}, + {83, "NUM5"}, + {84, "NUM6"}, + {85, "NUM7"}, + {86, "NUM8"}, + {87, "NUM9"}, + {88, "NUMPLUS"}, + {89, "NUMMINUS"}, + {90, "NUMMULTIPLY"}, + {91, "NUMDIVIDE"}, + {92, "NUMENTER"}, + {93, "NUMPERIOD"}, }; - int lastAlphaNumeric = 36; - for(const struct Row* row = Rows, *end = row + lastAlphaNumeric; row < end; row++) + int numAlphaNumericRows = 36; + int numNonAlphaNumericRows = COUNT_OF(Rows) - numAlphaNumericRows; + int numRowPairs = MAX(numAlphaNumericRows, numNonAlphaNumericRows); + const struct Row* row = Rows; + for(int i=0; icode, row->key); - if (otherRow < Rows + COUNT_OF(Rows)) + if (i < numAlphaNumericRows) + ptr += sprintf(ptr, "%4d | %-3s |", row->code, row->key); + else + ptr += sprintf(ptr, "%4s | %3s |", "", ""); + + const struct Row* otherRow = row + numAlphaNumericRows; + if (i < numNonAlphaNumericRows) ptr += sprintf(ptr, " | %4d | %-12s |", otherRow->code, otherRow->key); else ptr += sprintf(ptr, " | %4s | %12s |", "", ""); From afb5c919d60f47952ac57cb2060ad45b164cde16 Mon Sep 17 00:00:00 2001 From: Cort <1944792+cdwfs@users.noreply.github.com> Date: Sat, 9 Sep 2023 21:13:21 -0700 Subject: [PATCH 3/3] Fix off-by-one error in keycode table --- src/studio/screens/console.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/studio/screens/console.c b/src/studio/screens/console.c index 3369abf57..2e13ef670 100644 --- a/src/studio/screens/console.c +++ b/src/studio/screens/console.c @@ -3156,22 +3156,22 @@ static s32 createKeysTable(char* buf) {76, "F10"}, {77, "F11"}, {78, "F12"}, - {78, "NUM0"}, - {79, "NUM1"}, - {80, "NUM2"}, - {81, "NUM3"}, - {82, "NUM4"}, - {83, "NUM5"}, - {84, "NUM6"}, - {85, "NUM7"}, - {86, "NUM8"}, - {87, "NUM9"}, - {88, "NUMPLUS"}, - {89, "NUMMINUS"}, - {90, "NUMMULTIPLY"}, - {91, "NUMDIVIDE"}, - {92, "NUMENTER"}, - {93, "NUMPERIOD"}, + {79, "NUM0"}, + {80, "NUM1"}, + {81, "NUM2"}, + {82, "NUM3"}, + {83, "NUM4"}, + {84, "NUM5"}, + {85, "NUM6"}, + {86, "NUM7"}, + {87, "NUM8"}, + {88, "NUM9"}, + {89, "NUMPLUS"}, + {90, "NUMMINUS"}, + {91, "NUMMULTIPLY"}, + {92, "NUMDIVIDE"}, + {93, "NUMENTER"}, + {94, "NUMPERIOD"}, }; int numAlphaNumericRows = 36;