Emulated analog strikes via keydown duration
Posted: Sat Oct 10, 2015 2:09 pm
Hi I'm not fluent with python or much of a programmer, I stumbled upon FreePIE&vJoy combination when looking for an emulated input solution and I initially found a script that looked promising (specificly the braking/acceleration logic, a climbing value over time) but when put into the games I wanted they don't work as intended, ie changing the rate only changes the output so there isn't a weaker strike no matter how fast you let up or the values aren't consistant when its been pressed for the full length of time.
At the moment I only have a binary operation [that works consistantly] and I'm not finding any timing/stopwatch(?) samples to work off that work with FreePIE and the python standard library that was linked doesn't explain a lot of what was used in that script I linked above, which is very frustrating.
I'd like a way to get granular values from a 250 ms timeframe? so lets say I only held NU_key down for 125ms it would result in something like v.y = (15615 * (%of250ms)). I assume it would have to be restructured to: time KeyDown then send the value on KeyUp (values over 100% shouldn't matter).
At the moment I only have a binary operation [that works consistantly] and I'm not finding any timing/stopwatch(?) samples to work off that work with FreePIE and the python standard library that was linked doesn't explain a lot of what was used in that script I linked above, which is very frustrating.
Code: Select all
if starting:
v = vJoy[0]
NL_key = Key.Q
NU_key = Key.R
NR_key = Key.E
if keyboard.getKeyDown(NL_key):
v.y = 12000
v.x = -6000
elif keyboard.getKeyDown(NU_key):
v.y = 15615
elif keyboard.getKeyDown(NR_key):
v.y = 12000
v.x = 6000
else:
v.y = 0
v.x = 0