In some cases isKeyDown returns incorrect values. It returns true for keys that are not pressed. It happens after using the midi player.
Steps to reproduce:
- Open HALion 6 standalone
- Load attached preset
- Load a midi file or record your own. Something that contains chords and sustain pedal
- Start playback for a few seconds and then press Stop
Script will loop through all the keys and prints the keys which are returned as true by isKeyDown
function printKeysDown()
for key = 0, 127 do
if isKeyDown(key) then
print("Key ", key, " ", isKeyDown(key))
end
end
print("***")
end
function onInit()
print("Init")
printKeysDown()
end
function onController(e)
postEvent(e)
if e.controller == 120 and e.value == 127 then
print("Stop Playback")
printKeysDown()
end
end
IsKeyDown.vstpreset (992.8 KB)