copy / v86

x86 PC emulator and x86-to-wasm JIT, running in the browser
https://copy.sh/v86/
BSD 2-Clause "Simplified" License
19.74k stars 1.39k forks source link

Linux - Synchronize NumLock, CapsLock & ScrollLock #1071

Open evonox opened 3 months ago

evonox commented 3 months ago

NumLock, CapsLock & ScrollLock work correctly when the terminal window is active. However, if I click somewhere else, change the state of these keys and then click back to the terminal window, it works in the opposite direction.

I suggest upon re-activating the terminal window to check the state of these flags and send to the terminal virtual e.g. NumLock press if it is not synchronized. To my surprise, the current API of browsers allows to check the state of NumLock / CapsLock / ScrollLock - https://www.w3schools.com/jsref/event_mouse_getmodifierstate.asp

copy commented 3 months ago

A PR would be welcome.

evonox commented 3 months ago

Ok, I will prepare Pull Request for this issue.