update char press
This commit is contained in:
parent
2f1c112640
commit
8541bb3306
|
|
@ -738,6 +738,7 @@ void SetWindowFocused(void)
|
|||
void *GetWindowHandle(void)
|
||||
{
|
||||
if (platform.window == NULL) return NULL;
|
||||
|
||||
#ifdef RGFW_WASM
|
||||
return (void *)platform.window->src.ctx;
|
||||
#else
|
||||
|
|
@ -1177,17 +1178,6 @@ void PollInputEvents(void)
|
|||
|
||||
if (CORE.Input.Keyboard.currentKeyState[CORE.Input.Keyboard.exitKey]) RGFW_window_setShouldClose(platform.window, true);
|
||||
}
|
||||
|
||||
// TODO: RGFW_keyChar? new window event?
|
||||
//
|
||||
// NOTE: event.text.text data comes an UTF-8 text sequence but we register codepoints (int)
|
||||
// Check if there is space available in the queue
|
||||
// if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE)
|
||||
// {
|
||||
// // Add character (codepoint) to the queue
|
||||
// CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = RGFW_rgfwToKeyChar(rgfw_event.key.value);
|
||||
// CORE.Input.Keyboard.charPressedQueueCount++;
|
||||
// }
|
||||
} break;
|
||||
case RGFW_keyReleased:
|
||||
{
|
||||
|
|
@ -1195,6 +1185,18 @@ void PollInputEvents(void)
|
|||
if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0;
|
||||
} break;
|
||||
|
||||
case RGFW_keyChar:
|
||||
{
|
||||
// NOTE: event.text.text data comes an UTF-8 text sequence but we register codepoints (int)
|
||||
// Check if there is space available in the queue
|
||||
if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE)
|
||||
{
|
||||
// Add character (codepoint) to the queue
|
||||
CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = rgfw_event.keyChar.value;
|
||||
CORE.Input.Keyboard.charPressedQueueCount++;
|
||||
}
|
||||
} break;
|
||||
|
||||
// Check mouse events
|
||||
case RGFW_mouseScroll:
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user