emscripten-core / emscripten-core/emscripten

SDL could not get keyboard's caps/num locks in sync

Open
#16,121 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

The test program with source is attached.

Working case:
1. With both caps/num lock off.
2. load the wasm apps, when caps is on, yellow is display on the left half of the screen, when num lock is on red is displayed on the right half of the screen.

Not working case:

1.1. Turn on either caps/num lock or both.
1.2. load the wasm apps with the attached code, the status of caps/num lock could not be display properly.
2.1. With both caps/num lock off.
2.2. load the wasm apps.
2.3. Move focus to other window, and toggle caps/num lock
2.4. Move focus back to the browser window, caps/num lock's status could not be updated.

The linux version is running without problem.

It seems emscripten or the SDL emscripten driver is not passing the caps/num lock status to SDL when those keys' status is changed outside of the browser.

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.2 (a77b559a8b40b7e89fc8c17e41034128df9543e4)
clang version 14.0.0 (https://github.com/llvm/llvm-project 782c0dd1a1c235afb09a34e7da4a1267ead14765)
Target: wasm32-unknown-emscripten
Thread model: posix

[locktest.tar.gz](https://github.com/emscripten-core/emscripten/files/7946863/locktest.tar.gz)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.