16
Programming / Re: DosDevIOCtl disabling keyboard in VIO mode
« on: March 02, 2024, 08:40:26 pm »Did I make a second mistake in the above code?
Yes: your code fails to accommodate the environment it finds itself in.
In fullscreen mode it works because it assumes ASCII (correctly), switches to binary (to capture special key-combos?), then restores ASCII. IOW, it all works exactly as you'd expect a primitive terminal would when accessing real hardware.
However, iIn VIO mode that isn't the case: this is an _emulation_ provided by Presentation Manager. PM has its own good reasons for switching to binary mode before giving you an emulated console. Since it appears to get unhappy when you mess with it ..umm.. don't.
What are you trying to do? Capture Ctrl-C and the like? If so, there are probably higher-level 32-bit functions to handle this (e.g. DosSetSignalExceptionFocus() ).