mouse clicks to control keyboard Please help

Official forum for open source FreePIE discussion and development.
Post Reply
rodentz3
One Eyed Hopeful
Posts: 4
Joined: Sun Jan 03, 2016 7:06 am

mouse clicks to control keyboard Please help

Post by rodentz3 »

hi,

I have just started using freepie and I am struggling to work it out. I am a disabled gamer and I am using eye gaze for steering in racing games and I want to use left mouse button for brake and the right mouse button for throttle. I can't work out how to do this so any help would be greatly appreciated.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: mouse clicks to control keyboard Please help

Post by CyberVillain »

You want the gaze stuff to be controller using FreePIE? we have Tobii support, you have one?
rodentz3
One Eyed Hopeful
Posts: 4
Joined: Sun Jan 03, 2016 7:06 am

Re: mouse clicks to control keyboard Please help

Post by rodentz3 »

I have the eye gaze part working well and isn't the issue. The joystick on my wheelchair can be operated as a bluetooth mouse and I use this as left and right mouse clicks. When in a racing game for example I steer with eye gaze and I have this working. I want to be able to click and hold left and right mouse buttons and that triggers a press and hold of a keyboard key until I release the mouse button. I can get this to work for a single key press through freepie but not a press and hold, any ideas?
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: mouse clicks to control keyboard Please help

Post by konstantin_lozev »

Maybe a stupid idea - but would the game not accept remapping to mouse buttons? If not, just tell me which keyboard keys are bound to acceleration/brakes and I can give you a 2-liner in GlovePIE (maybe in FreePIE too). Unless Cyper is faster :)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: mouse clicks to control keyboard Please help

Post by CyberVillain »

Hmm, you want the key to be pressed as long as the mouse button?

Then you just do

Code: Select all

keyboard.setKey(Key.W, mouse.leftButton)
If you want to press the mouse button once and the keyboard key should be kept pressed until mouse click again (toggle) you can do

Code: Select all

if starting:
	enabled = False
	
if mouse.getPressed(0):
	enabled = not enabled
	keyboard.setKey(Key.W, enabled)
rodentz3
One Eyed Hopeful
Posts: 4
Joined: Sun Jan 03, 2016 7:06 am

Re: mouse clicks to control keyboard Please help

Post by rodentz3 »

thank you for the help, I will try it out
Post Reply

Return to “FreePIE”