diff options
| author | Ray <[email protected]> | 2023-11-10 19:25:28 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-11-10 19:25:28 +0100 |
| commit | e4ea116857464707d2508ae66f8feae8b68d5594 (patch) | |
| tree | bcf3e5bcb289e54620ab21a1330e6f6a6771e566 /src | |
| parent | 16b79f2c707d53836cdf67d7d9314746c95a4b10 (diff) | |
| download | raylib-e4ea116857464707d2508ae66f8feae8b68d5594.tar.gz raylib-e4ea116857464707d2508ae66f8feae8b68d5594.zip | |
Reviewing automation events on web...
Diffstat (limited to 'src')
| -rw-r--r-- | src/platforms/rcore_desktop.c | 2 | ||||
| -rw-r--r-- | src/platforms/rcore_web.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index 426d9fc0..5a3627cd 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -1106,12 +1106,12 @@ void PollInputEvents(void) // Reset keys/chars pressed registered CORE.Input.Keyboard.keyPressedQueueCount = 0; CORE.Input.Keyboard.charPressedQueueCount = 0; - // Reset key repeats for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) CORE.Input.Keyboard.keyRepeatInFrame[i] = 0; // Reset last gamepad button/axis registered state CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN //CORE.Input.Gamepad.axisCount = 0; + // Keyboard/Mouse input polling (automatically managed by GLFW3 through callback) // Register previous keys states diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 1fe4d584..2b9da11b 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -559,12 +559,12 @@ void PollInputEvents(void) // Reset keys/chars pressed registered CORE.Input.Keyboard.keyPressedQueueCount = 0; CORE.Input.Keyboard.charPressedQueueCount = 0; - // Reset key repeats for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) CORE.Input.Keyboard.keyRepeatInFrame[i] = 0; // Reset last gamepad button/axis registered state CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN //CORE.Input.Gamepad.axisCount = 0; + // Keyboard/Mouse input polling (automatically managed by GLFW3 through callback) // Register previous keys states @@ -592,7 +592,6 @@ void PollInputEvents(void) // so, if mouse is not moved it returns a (0, 0) position... this behaviour should be reviewed! //for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.position[i] = (Vector2){ 0, 0 }; - CORE.Window.resizedLastFrame = false; // Gamepad support using emscripten API // NOTE: GLFW3 joystick functionality not available in web @@ -661,6 +660,12 @@ void PollInputEvents(void) CORE.Input.Gamepad.axisCount[i] = gamepadState.numAxes; } } + + CORE.Window.resizedLastFrame = false; + + // This code does not seem to do anything?? + //if (CORE.Window.eventWaiting) glfwWaitEvents(); // Wait for in input events before continue (drawing is paused) + //else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) } |
