mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(input_keyboard.c) Cleanups
This commit is contained in:
parent
5214c29295
commit
5db3f4528d
@ -42,21 +42,21 @@ struct input_keyboard_line
|
|||||||
};
|
};
|
||||||
|
|
||||||
static bool input_driver_keyboard_linefeed_enable = false;
|
static bool input_driver_keyboard_linefeed_enable = false;
|
||||||
static input_keyboard_line_t *g_keyboard_line;
|
static input_keyboard_line_t *g_keyboard_line = NULL;
|
||||||
|
|
||||||
|
static void *g_keyboard_press_data = NULL;
|
||||||
|
|
||||||
|
static bool return_pressed = false;;
|
||||||
|
|
||||||
|
static unsigned osk_last_codepoint = 0;
|
||||||
|
static unsigned osk_last_codepoint_len = 0;
|
||||||
|
|
||||||
static input_keyboard_press_t g_keyboard_press_cb;
|
static input_keyboard_press_t g_keyboard_press_cb;
|
||||||
|
|
||||||
static void *g_keyboard_press_data;
|
|
||||||
|
|
||||||
static bool return_pressed;
|
|
||||||
|
|
||||||
static unsigned osk_last_codepoint = 0;
|
|
||||||
static unsigned osk_last_codepoint_len = 0;
|
|
||||||
|
|
||||||
static void osk_update_last_codepoint(const char *word)
|
static void osk_update_last_codepoint(const char *word)
|
||||||
{
|
{
|
||||||
const char *letter = word;
|
const char *letter = word;
|
||||||
const char *pos = letter;
|
const char *pos = letter;
|
||||||
|
|
||||||
if (letter[0] == 0)
|
if (letter[0] == 0)
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ static void osk_update_last_codepoint(const char *word)
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
unsigned codepoint = utf8_walk(&letter);
|
unsigned codepoint = utf8_walk(&letter);
|
||||||
unsigned len = letter - pos;
|
unsigned len = letter - pos;
|
||||||
|
|
||||||
if (letter[0] == 0)
|
if (letter[0] == 0)
|
||||||
{
|
{
|
||||||
@ -222,11 +222,12 @@ static bool input_keyboard_line_event(
|
|||||||
|
|
||||||
bool input_keyboard_line_append(const char *word)
|
bool input_keyboard_line_append(const char *word)
|
||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
unsigned len = strlen(word);
|
unsigned len = strlen(word);
|
||||||
|
|
||||||
char *newbuf = (char*)
|
char *newbuf = (char*)
|
||||||
realloc(g_keyboard_line->buffer, g_keyboard_line->size + len*2);
|
realloc(g_keyboard_line->buffer,
|
||||||
|
g_keyboard_line->size + len*2);
|
||||||
|
|
||||||
if (!newbuf)
|
if (!newbuf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user