Closed Warepire closed 7 years ago
I should add, nothing is open except the game and the Lua console, and the game has focus when this happens. Not recording a movie either.
Simple test script:
while true do
local keysToCheck = {"J", "K", "L"}
local keys = input.get()
for i, v in ipairs(keysToCheck) do
if keys[v] == true and keysPrev[v] ~= true then
console.log(string.format("key %s pressed!", v))
end
end
keysPrev = input.get()
emu.frameadvance()
end
Just committed what should be a fix for this. Part of the "luainterface and nlua never supported coroutines so we had to do it ourselves" mastertask which I have not noticed needed doing for years.
Fixed it in luainterface too -- it might have been the cause of the crashes. Or it might just make things worse.
Tested NLua+KopiLua on the latest master, I can no longer trigger this problem. Thanks!
Windows 7, BizHawk 2.1, NLua+KopiLua backend. Seen with PSX core.
Using
input.get()
to turn features on and off in a Lua script will eventually stop working after a random(?) amount of time. Meaning that pressing keys on the keyboard will no longer have the keys register as pressed in the dictionary provided by theinput.get()
function.I made sure the keys are not used as hotkeys / input keys.
If I need to provide anything else, let me know.