Add HAVE_LANGEXTRA to menu_osk.c

This commit is contained in:
twinaphex 2017-01-29 20:01:26 +01:00
parent a9c8c81032
commit c2c2521b12
2 changed files with 14 additions and 1 deletions

@ -53,6 +53,7 @@ static const char *lowercase_grid[] = {
"a","s","d","f","g","h","j","k","l",";","",
"z","x","c","v","b","n","m"," ",",",".",""};
#ifdef HAVE_LANGEXTRA
static const char *hiragana_page1_grid[] = {
"","","","","","","","","","","",
"","","","","","","","","","","",
@ -76,6 +77,7 @@ static const char *katakana_page2_grid[] = {
"","","","","","","","","","","",
"","","","","","","","","","","",
"","","","","","","","","","",""};
#endif
void menu_event_set_osk_idx(enum osk_type idx)
{
@ -102,11 +104,14 @@ void menu_event_osk_append(int ptr)
if (ptr < 0)
return;
#ifdef HAVE_LANGEXTRA
if (string_is_equal(osk_grid[ptr],""))
input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD);
else if (string_is_equal(osk_grid[ptr],""))
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
else if (string_is_equal(osk_grid[ptr],""))
else
#endif
if (string_is_equal(osk_grid[ptr],""))
menu_event_set_osk_idx(OSK_UPPERCASE_LATIN);
else if (string_is_equal(osk_grid[ptr],""))
menu_event_set_osk_idx(OSK_LOWERCASE_LATIN);
@ -123,6 +128,7 @@ void menu_event_osk_iterate(void)
{
switch (menu_event_get_osk_idx())
{
#ifdef HAVE_LANGEXTRA
case OSK_HIRAGANA_PAGE1:
memcpy(osk_grid, hiragana_page1_grid, sizeof(hiragana_page1_grid));
break;
@ -135,6 +141,7 @@ void menu_event_osk_iterate(void)
case OSK_KATAKANA_PAGE2:
memcpy(osk_grid, katakana_page2_grid, sizeof(katakana_page2_grid));
break;
#endif
case OSK_UPPERCASE_LATIN:
memcpy(osk_grid, uppercase_grid, sizeof(uppercase_grid));
break;

@ -24,6 +24,10 @@
#include <retro_common_api.h>
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
#define OSK_CHARS_PER_LINE 11
RETRO_BEGIN_DECLS
@ -33,10 +37,12 @@ enum osk_type
OSK_TYPE_UNKNOWN = 0U,
OSK_LOWERCASE_LATIN,
OSK_UPPERCASE_LATIN,
#ifdef HAVE_LANGEXTRA
OSK_HIRAGANA_PAGE1,
OSK_HIRAGANA_PAGE2,
OSK_KATAKANA_PAGE1,
OSK_KATAKANA_PAGE2,
#endif
OSK_TYPE_LAST
};