Page 1 of 1

Mouse button / keyboard not mapping to vJoy buttons

Posted: Sun Oct 08, 2017 7:41 pm
by distrachi
I don't know why but I can't get my mouse button or keyboard inputs mapped to any of the vJoy buttons. Below is the script snippet and attached is the full script. I'm running Win 10 64 bit, vJoy 2.1.8.38, FreePIE 1.9.629.0.

Code: Select all

# assign button 
	vJoy[0].setButton(1,int(mouse.leftButton)) 
	vJoy[0].setButton(2,int(mouse.rightButton)) 
	vJoy[0].setButton(3,int(mouse.middleButton)) 
	vJoy[0].setButton(4,int(keyboard.getKeyDown(Key.E))) 
	vJoy[0].setButton(5,int(keyboard.getKeyDown(Key.R))) 
	vJoy[0].setButton(6,int(keyboard.getKeyDown(Key.T))) 
	vJoy[0].setButton(7,int(keyboard.getKeyDown(Key.Y))) 

Re: Mouse button / keyboard not mapping to vJoy buttons

Posted: Sun Oct 08, 2017 7:53 pm
by distrachi
Another thing I noticed is that when I open the Windows Game Controller configuration app and I use the vJoy feeder app, the buttons do not register as being pressed in Windows Game Controller app. But when I open "Monitor vJoy" app and "vJoy Feeder" app I can get the button presses to register.

Using the mouse steer script, both Monitor vJoy and Game Controller config apps don't register button presses when i click my mouse buttons.

Re: Mouse button / keyboard not mapping to vJoy buttons

Posted: Mon Oct 09, 2017 6:17 am
by MarijnS95
You have that piece of code in the if starting: block, meaning that it only executes once, when the script starts. Remove the indentation and it should work.

Also, why are you converting the booleans to integers?

Re: Mouse button / keyboard not mapping to vJoy buttons

Posted: Mon Oct 09, 2017 11:11 am
by distrachi
Thanks so much MarijnS95! I removed the indentation and it works. I copied the code from a very very old post in another forum but some of the formatting was lost.

I have no idea why the original creator of the script is converting booleans to int.