summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-10-11 11:47:30 -0400
committerGitHub <noreply@github.com>2021-10-11 11:47:30 -0400
commitf55a8cb688267cf5b9aa2da08d9c2523f4c0d702 (patch)
treef760e6d528c4b697a80752243c641253622b305b /src
parente26f9d10d7bebee5ea512fc4729ce6adafec66a0 (diff)
parenta556856ce94f3b96879eb9972cd1a12a30f4a154 (diff)
Merge pull request #1513 from GriffinRichards/fix-keyboarchars
Convert sKeyboardChars to 3D array
Diffstat (limited to 'src')
-rw-r--r--src/naming_screen.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/naming_screen.c b/src/naming_screen.c
index 19da9da02..f6558921b 100644
--- a/src/naming_screen.c
+++ b/src/naming_screen.c
@@ -286,19 +286,26 @@ static const struct WindowTemplate sWindowTemplates[WIN_COUNT + 1] =
// This handles what characters get inserted when a key is pressed
// The keys shown on the keyboard are handled separately by sNamingScreenKeyboardText
-static const u8 sKeyboardChars[KBPAGE_COUNT * KBROW_COUNT * KBCOL_COUNT] = __(
- "abcdef ."
- "ghijkl ,"
- "mnopqrs "
- "tuvwxyz "
- "ABCDEF ."
- "GHIJKL ,"
- "MNOPQRS "
- "TUVWXYZ "
- "01234 "
- "56789 "
- "!?♂♀/- "
- "…“”‘' ");
+static const u8 sKeyboardChars[KBPAGE_COUNT][KBROW_COUNT][KBCOL_COUNT] = {
+ [KEYBOARD_LETTERS_LOWER] = {
+ __("abcdef ."),
+ __("ghijkl ,"),
+ __("mnopqrs "),
+ __("tuvwxyz "),
+ },
+ [KEYBOARD_LETTERS_UPPER] = {
+ __("ABCDEF ."),
+ __("GHIJKL ,"),
+ __("MNOPQRS "),
+ __("TUVWXYZ "),
+ },
+ [KEYBOARD_SYMBOLS] = {
+ __("01234 "),
+ __("56789 "),
+ __("!?♂♀/- "),
+ __("…“”‘' "),
+ }
+};
static const u8 sPageColumnCounts[KBPAGE_COUNT] = {
[KEYBOARD_LETTERS_LOWER] = KBCOL_COUNT,
@@ -1780,7 +1787,7 @@ static void DrawGenderIcon(void)
static u8 GetCharAtKeyboardPos(s16 x, s16 y)
{
- return sKeyboardChars[x + y * KBCOL_COUNT + CurrentPageToKeyboardId() * KBCOL_COUNT * KBROW_COUNT];
+ return sKeyboardChars[CurrentPageToKeyboardId()][y][x];
}