Dear Roy,
indeed, the problem was introduced when switching to a WxWidgets based keyboard state function;
but obviously, those functions are not reliable under high CPU load (or maybe need better handling from BricsCAD side).
Now I have fixed by additionally verifying the Windows API functions for keyboard state, and your sample code runs fine; not yet published, but likely in next BricsCAD update.
You should have sent a bug report - then I would have fixed it much earlier
Many thanks & many greetings !