Problem with wheelUp wheelDown

Official forum for open source FreePIE discussion and development.
Post Reply
dazeysan
One Eyed Hopeful
Posts: 3
Joined: Mon Apr 28, 2014 11:47 pm

Problem with wheelUp wheelDown

Post by dazeysan »

I just started messing around with FreePIE but am stuck with an odd problem.

I am trying to map joystick buttons to mouse.wheelUp and mouse.wheelDown which works fine except that the second line of code seems to block/disable the first.

Here's an example mapping keyboard keys to the mouse wheel. Each line works by itself but if you have both in the script, then the first one doesn't work.

Code: Select all

mouse.wheelUp = keyboard.getPressed(Key.W)
mouse.wheelDown = keyboard.getPressed(Key.S)
If you swap them around so that the wheelDown line is on top then wheelDown stops working and wheelUp starts working.

Any ideas?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problem with wheelUp wheelDown

Post by CyberVillain »

hmm, Wheel up down changes the same API value. so currently that wont work since the one not being pressed will reset the other one, until fixed please only set down up if its really pressed.

Will fix for next release
dazeysan
One Eyed Hopeful
Posts: 3
Joined: Mon Apr 28, 2014 11:47 pm

Re: Problem with wheelUp wheelDown

Post by dazeysan »

Thanks for the quick reply. So nice to see active development in projects.

Please let me know if there's a better way I should be handling this. I tried setting mouse.wheel to positive and negative values but even at 1/-1 it would scroll really far. I am trying to scroll through slots in a inventory bar where one "tick" on the mouse wheel is one slot.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problem with wheelUp wheelDown

Post by CyberVillain »

You can do it like this until the bug is fixed

Code: Select all

if keyboard.getPressed(Key.W):
	mouse.wheelUp = True	

if keyboard.getPressed(Key.S):
	mouse.wheelDown = True
dazeysan
One Eyed Hopeful
Posts: 3
Joined: Mon Apr 28, 2014 11:47 pm

Re: Problem with wheelUp wheelDown

Post by dazeysan »

I just got a chance to test that code and it worked great.

Thank you! :D
Post Reply

Return to “FreePIE”