It is currently Sun Jan 19, 2020 2:46 am



Reply to topic  [ 5 posts ] 
 need help writing mouse x&y axis to FP/vjoy code 
Author Message
One Eyed Hopeful

Joined: Tue Aug 04, 2015 5:59 pm
Posts: 3
Reply with quote
I needed someone to write a free PIE code to transpose the mouse X & Y axis movement to the vjoy X&Y analog axis.

I will need the following functions added:

-Separate adjustable mouse sensitivity for both axis

-adjustable deadzone

-autocentering once the mouse stops moving

(I'm running win7)
I do not need the mouse buttons...only mouse movement coded. If this work takes some time...I am willing to pay for services if need be.

Thanks in advance,
Chris


Wed Aug 05, 2015 12:17 pm
Profile
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2164
Location: Stockholm, Sweden
Reply with quote
We only have delta mouse movement so you need to convert this to aboslute cordinates. Then you need to have some logic that detects that the mouse stoped movign for a ceratin period for example doing filters.stopWatch(mouse.deltaX == 0 and mouse.deltaX == 0, 500)

_________________
FreePIE
My blog


Mon Aug 17, 2015 6:52 am
Profile
One Eyed Hopeful

Joined: Tue Aug 04, 2015 5:59 pm
Posts: 3
Reply with quote
thanks for the response, but i have NO idea how to code.... also I dont know what Delta mouse movement means exactly. I'm assuming your response is refering to the autocentering part of what i needed, since all the other functions I've listed are seen working in other codes.

Is this something you would be able to code/write for me? ...or know who could?

...like I said, I CAN pay for services, I have NO problem w that. Im sure what your talking about would take time.


Tue Aug 18, 2015 1:49 pm
Profile
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2164
Location: Stockholm, Sweden
Reply with quote
Heres a start

Code:
if starting:
   x = 0
   y = 0
   ratioX = 100
   ratioY = 100
   recenterTimeout = 500
      
   
   
x = x + mouse.deltaX * ratioX
y = y + mouse.deltaY * ratioY

vJoy[0].x = x
vJoy[0].y = y

if filters.stopWatch(mouse.deltaX == 0 and mouse.deltaX == 0, recenterTimeout):
   x = 0
   y = 0

_________________
FreePIE
My blog


Tue Aug 18, 2015 4:01 pm
Profile
One Eyed Hopeful

Joined: Tue Aug 04, 2015 5:59 pm
Posts: 3
Reply with quote
!! I dont have words for this... you made my weekend !! Thank you!!

Now I did try changing the values of the ratio & recenterTimeout...that works well....but, does changing the x = 0 or y = 0 do anything? I tried, but nothing seems to be diffrerent, no matter how slow/fast i move the mouse.

Would you also be able to add an adjustable deadzone line in this code?


Thu Aug 20, 2015 7:42 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.