Page 1 of 1

multiple mice with freepie possible?

Posted: Mon Nov 06, 2017 2:16 am
by Bluedeath
Hi top all i need to read 2 mice values to feed the data to 4 differet axis in VJOY, is there any way to achieve that with freepie, internally or by using external python support?

Thanks in advance to all.

Re: multiple mice with freepie possible?

Posted: Mon Nov 06, 2017 4:09 am
by zelmon64
Hi Bluedeath,

I don't believe it's currently possible but from looking at this we might be able to add it in. If you try the ShowMultipleMiceValues.exe example you can see if your mice are distinguishable (some of mine are but some aren't).

Re: multiple mice with freepie possible?

Posted: Thu Nov 09, 2017 8:24 am
by Jabberwock
Zelmon... you are incredible!

I have been trying for weeks to make MAME recognize my graphic tablet/Razer Hydra as a lightgun. I was sure I have tried all relevant options... And now you just casually respond to a completely different topic with a simple link... and my problems are solved - with a single setting BOTH the tablet and Hydra are working! How are you doing that?!

Re: multiple mice with freepie possible?

Posted: Sat Nov 11, 2017 4:47 am
by zelmon64
@Jabberwock wow that is very serendipitous! Good on you for taking the time to look at the link. Do you store your FreePIE scripts online somewhere? Your setups sound quite interesting. They would probably benefit others (plus an online backup is recommended).

Re: multiple mice with freepie possible?

Posted: Sat Nov 11, 2017 5:33 am
by Jabberwock
It is true I am a bit of a controller freak. I even still have a P5 glove somewhere in a box.

I might upload the scripts somewhere, if you do not mind bad Python programming and no comments whatsoever. I am not sure though if the Balance Board scripts can be revealed, as they have weight thresholds specified very clearly. In kilograms.

Re: multiple mice with freepie possible?

Posted: Thu Feb 21, 2019 7:08 am
by steve1979
Jabberwock wrote:Zelmon... you are incredible!

I have been trying for weeks to make MAME recognize my graphic tablet/Razer Hydra as a lightgun. I was sure I have tried all relevant options... And now you just casually respond to a completely different topic with a simple link... and my problems are solved - with a single setting BOTH the tablet and Hydra are working! How are you doing that?!

Hi hoping someone can help me out, i am also trying to get the razer hydra to work in MAME. i've got MAME to recognise the buttons and trigger on the hydra but not the x and y axis, can you please share what you did to get the hydra working in MAME. Thanks in advanve for any help with this problem.

Re: multiple mice with freepie possible?

Posted: Fri Feb 22, 2019 6:35 am
by Jabberwock
If I remember correctly, it was a setting in MAME that you had to change in order for the script to work. Look at the link provided by zelmon. My script itself is rather simple:

Code: Select all

vJoy[0].x = filters.ensureMapRange(hydra[0].yaw, -0.5, 0.5, -32000, 32000)
vJoy[0].y = filters.ensureMapRange(hydra[0].pitch, 0.5, -0.5, -32000, 32000)

vJoy[0].setButton(0, hydra[0].trigger)
vJoy[0].setButton(1, hydra[0].bumper)

Re: multiple mice with freepie possible?

Posted: Fri Feb 22, 2019 12:21 pm
by steve1979
Thanks for the script, the hydra works well in some emulators just using mce but I was really struggling to get it to work in mame. I don't have a clue about writing scripts so really appreciate this thanks again.

Re: multiple mice with freepie possible?

Posted: Fri Feb 22, 2019 5:02 pm
by Jabberwock
Well, I just copied the script that is titled HydraLightgun on my computer... But given what I have written above, it might have been a mouse emulation script (as the setting worked for the graphic tablet as well). The only relevant script I found now is this one:

Code: Select all

import ctypes

def globals():
	global startX
	global startY

diagnostics.watch(hydra[0].x)
diagnostics.watch(hydra[0].y)

if starting:
	startX = 960
	startY = 600

if(hydra[0].start):
	startX = 960 - (hydra[0].x * 4)
	diagnostics.watch(startX)
	startY = 600 - (-hydra[0].y * 4)
	diagnostics.watch(startY)

#x = filters.ensureMapRange(hydra[0].x, -500, 500, 0, 1920)
x = int(hydra[0].x * 4 + startX)
y = int(-hydra[0].y * 4 + startY)	
diagnostics.watch(x)
diagnostics.watch(y)

if not hydra[0].bumper:
	ctypes.windll.user32.SetCursorPos(x,y)

mouse.leftButton = hydra[0].trigger
If read it correctly, it works as an absolute mouse, so maybe that would work combined with the right MAME setting. That seems to be the problem with me: I am quite interested in making odd controllers work, but once they do, I quickly lose interest...