-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodic execution decorator appears broken #239
Comments
Are periodic functions broken at large in the current release? I'm seeing invocations, and the input viewer updates, but execution seems to stop unexpectedly during in-game use. Minimal code:
In addition, the vjoy device doesn't seem to be available consistently. It might be unavailable (and thus throw an error) on any given frame. I've tried to work around this with Currently I'm using timers from python's threading model to sidestep the periodic decorator completely, but it's a messy hack that doesn't respect joystick gremlin's script lifecycle:
The use-case here is getting around MechWarrior 5's buggy turn handling. The turn axis doesn't zero out properly, instead holding at the last non-zero value received until another change is detected. I also want to use periodic invocation to implement finer axis-to-mouse mapping, as the current implementation doesn't appear to respect response curves or have a configurable tick rate, though there doesn't seem to be an exposed way to control the mouse from user scripts? Unless it's exposed via |
Yeah, the entire decorator is broken. I did look into it for a decent amount of time but couldn't figure out what went wrong with it. I haven't looked at it again since I added this issue, mainly because I didn't get a lot of time to work on Gremlin lately. Though with the sweeping changes that I have to do behind the scenes I will end up looking at this again. The mouse interfacing used by Gremlin is accessible by user scripts. Everything Gremlin uses is defined in https://github.com/WhiteMagic/JoystickGremlin/blob/develop/gremlin/sendinput.py There is a decent amount of sorcery going on in some of the more complex mouse motion behaviours though. Somewhere I should have an issue that calls for other types of events that can be hooked, such as enabling a profile, swapping modes, etc. If those did already exist, which they sadly don't, then those would have been a good way to work around the broken periodic decorator. |
Apparently the decorator does not work when a profile is initially activated, but on subsequent activations of profiles, it seems to do its job, see #272. This means that there is likely some setup code missing which the code activating and deactivating a profile resets to the correct state. |
A simple periodic callback function seems to be broken due to some issues with comparison operator for partial functions not existing. A simple example that breaks is the following:
The text was updated successfully, but these errors were encountered: