Hi Wim!
Hi Mark,
I 'm wondering if it may be related to USB polling rate?
Both my Corsair keyboards (one a K70 and the other a K95) are modern USB keyboards which are very good for regular applications, but are designed and engineered for gaming purposes first, where response time is important. I haven't looked up the specs yet but I suspect they may poll faster than most keyboards. As the joystick is very old and also being connected in a non standard way, does that sound plausible?
I assume running xevents and noting, right in the window on the desktop, the various responses, that would not be affected by the keyboard polling rate, but, in a DOS VDM, the keyboard may be "hijacking" control from the joystick regularly, hence the effect I'm referring to as "loss of focus".
I'm a hardware geek, but I'm not an engineer so I'm not sure how I could test that hypothesis - I'm also assuming that there is nothing that could be done with your REXX xevents program that could compensate for that (or in the device drivers?).
I tried and reproduced the "loss of focus" problem on my desktop computer. It appears that xevents.cmd needs to run at fixed high priority.
Had a few minutes this morning, so spent about 20 minutes playing with TMScope and the joystick - I tried both xevents2 and the original xevents to see if any differences were notable.
With xevents2, playing with the various joystick controls with the display up, I did not lose focus for about 5 minutes, then the inputs didn't work - hitting any key on my K70 keyboard resulted in the joystick again sending inputs to the TMScope display. Twice, using the mouse to operate the display buttons on the right hand side resulted in the joystick providing no input to TMScope, which was again fixed by pressing any button on the keyboard.
Switching back to xevents and running the same tests, the loss of focus seemed to occur faster and be more frequent - I was able again to recover hitting any key on the K70 - this may be just subjective, but it seemed with the original xevents, recovery, so that the joystick was again supplying input, seemed a little most sluggish, but that just may be my impression.
So, xevents2, with your modifications, seem to work much better with all the tests I've run, on 3 DOS programs - the "loss of focus" still occurs, but much less frequently.
I don't know how TMScope is measuring the "Port Speed" in the upper left hand corner of the TMScope display, but when I do that measurement (by pressing the button present on the right hand side, with the mouse), the port speed is reported as two notches up on the scale, instead of the 5 reported when the program starts (the default position), so it may indicate that the Logilink switch port input rate is quite low - but again that is just a subjective assessment, as the reported post speed is not being reported as a hard number, calculated scientifically - Until I get the USB based joystick I have nothing for comparison purposes.
I also did do some research on Corsair keyboard polling rates, and it was quite interesting.
They keep producing constantly updated versions of the same model keyboard, so you have to examine carefully, which ones they are referring to. Professional gaming seems to have exploded as a sporting competition, and looking at the current 2021 era Corsairs K-70 RGB Pro and K-70 RGB TKL (a smaller tournament grade keyboard where TKL stands for "ten keys less"), polling rates are running with advanced AXON technology at up to 8000 Hz (0.125 ms access time), in many cases programmable.
Those seem to be the big brothers to my K-70 RGB (which was purchased in 2020), which is polling, according to specs at 1000 Hz (1 ms access time) default, as opposed to normal keyboards in the 125 Hz range. My Corsair K-95 purchased in 2021 is similar. Both keyboards are completely similar in layout, with the addition of 6 programmable macro keys on the left on the K-95, and a less mechanical feel to the K-95 keys.
Its my understanding that PS/2 based keyboards and equipment were interrupt based not polling based, so I expect the joysticks of that era were similar - don't know how the Logilink game port to USB adapter translates that, but I expect response and access, like most workaround technology, would be slower. I'm sure you. Lars and others here would know far more about the subject than I do.
That completes my testing report for now- please advise if you would like me to test anything further Wim, based on the current equipment I have - I have not included any xevents.log files as I don't think they will tell you anything not referred to above - examining them after a DOS session indicates that the joystick is functioning correctly mechanically, and sending xevents reports at all times, with the current drivers - it is just the loss of focus problem that seems to be occurring here - my results may not be typical, because of the equipment I am using for testing - more testers may be needed to get a good idea of how your drivers are functioning generally.
Best as always!
Mark