I was able to test a DOS program in console on Win98/WinXP (VMs).
After some testing and reading, turns out that some key presses / releases generate scan codes that look exactly like left shift make / break codes.
I will commit a fix soon that resets the got_extended_key flag back to false. I did some testing and seems to be ok.