I am Using TrackIR to Simulate Mouse mouvement, Which Works GREAT
But i would need some specification on a couple hints .
:::PROBLEM 1:::
Right now, In FPS GAME. When i ::hold F7::, the script start perfectly and stops when i ::release F7::
-i can also Toggle it for testing Purposes with ::getPressed F12::.
-- I would like to Make this ::hold F7 ::but Instant , So i would rather just need to Click F7 once , rather then : Holding the hotkey, moving my head(Yaw,pitch,TrackIR) and release the Hotkey.
I TRYED, replacing :
hotkey = keyboard.getKeyDown(Key.F7)
with :
hotkey = keyboard.getPressed(Key.F7)
See Code Down Below
Freepie RUNS the script but it just doesnt seems to work as i intended .
=-=: I would need so when i :: Press F7 ::, the script Starts updating mouse.deltaX/Y, then Briefly after 100Millisecgond, set YAW and PITCH to 0(in my case 2.3 and 3)
::::::::::::::::::
::::PROBLEM 2::::
-- I would like to :: Right Click :: once, when i also hit once the :: F7 Key ::
SO i tryed :
Code: Select all
mouse.rightButton = Keyboard.getKeyUp(Key.F7)
it seems to right click and hold , until i Re-right click.
:::::The Code :::::
Code: Select all
#Use F12 to toggle on/off Or HOLD right mouse to activate Script
#(Good for FPS GAMES.)
def update():
yaw = trackIR.yaw
pitch = trackIR.pitch
deltaYaw = filters.delta(yaw)
deltaPitch = filters.delta(pitch)
if (enabled or hotkey):
mouse.deltaX = deltaYaw*multiplyX
mouse.deltaY = -deltaPitch*multiplyY
if starting:
enabled = False
multiplyX = 4
multiplyY = 5
trackIR.update += update
hotkey = keyboard.getKeyDown(Key.F7)
toggle = keyboard.getPressed(Key.F12)
if toggle:
enabled = not enabled