mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 00:24:09 +00:00
Merge pull request #16 from benwiley4000/click-listener
Clicking in the window re-captures the mouse.
This commit is contained in:
@@ -55,6 +55,7 @@ async function main (id) {
|
||||
function start (id) {
|
||||
BUTTONS.remove()
|
||||
document.body.className = ''
|
||||
setupClickListener()
|
||||
main(id)
|
||||
}
|
||||
|
||||
@@ -135,6 +136,15 @@ function setupCloseListener () {
|
||||
}
|
||||
}
|
||||
|
||||
function setupClickListener () {
|
||||
document.addEventListener('click', () => {
|
||||
if (!cursorCaptured) {
|
||||
cursorCaptured = true
|
||||
window.emulator.lock_mouse()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setupEscListener()
|
||||
setupCloseListener()
|
||||
setupButtons()
|
||||
|
||||
Reference in New Issue
Block a user