Mouse button / keyboard not mapping to vJoy buttons

Official forum for open source FreePIE discussion and development.
Post Reply
distrachi
One Eyed Hopeful
Posts: 3
Joined: Sun Oct 08, 2017 7:27 pm

Mouse button / keyboard not mapping to vJoy buttons

Post 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))) 
You do not have the required permissions to view the files attached to this post.
distrachi
One Eyed Hopeful
Posts: 3
Joined: Sun Oct 08, 2017 7:27 pm

Re: Mouse button / keyboard not mapping to vJoy buttons

Post 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.
MarijnS95
One Eyed Hopeful
Posts: 34
Joined: Tue Dec 22, 2015 12:52 pm

Re: Mouse button / keyboard not mapping to vJoy buttons

Post 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?
distrachi
One Eyed Hopeful
Posts: 3
Joined: Sun Oct 08, 2017 7:27 pm

Re: Mouse button / keyboard not mapping to vJoy buttons

Post 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.
Post Reply

Return to “FreePIE”