FreePIE icon indicating copy to clipboard operation
FreePIE copied to clipboard

Timers - Subsecond resolution?

Open PWBENNETT opened this issue 7 years ago • 4 comments

I have a situation where I want to briefly "tap" a button. In other words, setPressed(... True) when some event happens, record the T = time when it was pushed, let the event loop run a few milliseconds or so, and as soon as time > T + some_value, then I know it's safe to setPressed(... False). What's the best hi-res timer to access within IronPython?

PWBENNETT avatar Oct 27 '17 22:10 PWBENNETT

@PWBENNETT how quick a tap do you want? Here's some information on the timing. Here's an example. If you use setPressed(key) without a boolean it sends a brief tap.

zelmon64 avatar Oct 28 '17 11:10 zelmon64

I'm using vJoy.setPressed() at the moment, around line 33 of this:

https://gist.github.com/PWBENNETT/8f2c44f8b17d24fee7094459b5ec89b8

However, I found out this evening when I went to resume debugging it that none of my vJoy devices work at all. No errors, and reading the MIDI devices goes fine, but none of the vJoy axes or buttons are being changed when I slide sliders and twist knobs.

PWBENNETT avatar Oct 29 '17 04:10 PWBENNETT

For now, I'm reinstalling vJoy itself, but the installer isn't finishing (yet), even though it's been several minutes at 99% or 100% (it's hard to tell from the bar graph).

PWBENNETT avatar Oct 29 '17 04:10 PWBENNETT

Yeah, it seems that midi[n].update() on this type of control (like a jog wheel) leaves the buffer data with a control value of either 63 (turn -ve) or 65 (turn +ve), never returning it to "no update" / "not moving". This seems to be inherent in MIDI itself, since I've seen it with other software on other OSes. I'm guessing (on the fly) that my devices are maybe waiting for some kind of ACK in response before de-signalling its state. I will continue to research.

PWBENNETT avatar Nov 03 '17 15:11 PWBENNETT