Wiimote Script inspired by JSM

Official forum for open source FreePIE discussion and development.
Post Reply
GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Wiimote Script inspired by JSM

Post by GermanSani »

Hi,

I wrote a script that simulates the use of a Wiimote, in combination with a Nunchuck, as a Gyromouse.
I got the inspiration for many things in it from the Joyshock Mapper which is made by JibbSmart.

So far I have only tested it on Win10 with a -TR-Remote with inbuilt Motion Plus. But I guess that it should work fine also with a Motion-Plus adapter.
Let me know if there's anyting not working right or if you have any kind of feedback.
I'll try to help as much as I can with my quite basic programming skills but am surely willing to learn as well. ^^

Thank you and have fun :)
You do not have the required permissions to view the files attached to this post.
Last edited by GermanSani on Tue May 11, 2021 1:44 pm, edited 7 times in total.

GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Re: Wiimote Script inspired by JSM

Post by GermanSani »

New Version, new features:

- Possibility to make the Cursor move faster by a multiplier when moving the Wiimote faster around (I called it "SpeedBoost")

- Added the possibility of "Hold-Mapping".
This means you now can assign two additional keys to most buttons, one that will be pressed when you keep the button pressed for a certain (configurable) time and one that is pressed when you just tap the button.
So now you can theoretically assign up to 64 keys, practically you can use up to 38.

I have tried to test it as good as possible but if you encounter any errors feel free to tell me about it. :)
Last edited by GermanSani on Fri Apr 30, 2021 11:06 am, edited 1 time in total.

GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Re: Wiimote Script inspired by JSM

Post by GermanSani »

So, another update as I just had a little bit more time to spend:

- Possibility to hold the Wiimote horizontally
- Nunchuck can now als be removed
- Options to adjust cursor movement for TR and Non-TR-Wiimotes
- Pressing the GyroOff-Button and having RememberSpeed enabled will now gradually slow down the cursor (configurable)
- Skipable Mouse-Buttons
- Thread Interval customizable + explications

Everything SHOULD work fine but, still, if you find any errors or mistakes (or have better ideas for some of my code) let me know.

Edit:
Just saw that there was a bug with the Scroll-Wheel.
Additional there's now the possibility to use the Nunchuck-Stick for controlling the mouse as well if you want to.

GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Re: Wiimote Script inspired by JSM

Post by GermanSani »

So I've put the next version in a .rar-File now as I can't post much longer code anymore.
I'd like to make it shorter but I, at the moment, just don't know what I could wrote more efficiently or at least shorter in it.

Well, in this version there's new:

- You can decide if you want to use 4 directions of the Nunchuck-Stick as mappable or 8 directions.
The 8 directions option, however, isn't a good choice when moving around with the Stick (like in e.g. a FPS) as the dedicated areas for each button prevent a smooth transition between directions.
- The recalibration now only starts when you press 1 + 2 for more than 3 seconds.

GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Re: Wiimote Script inspired by JSM

Post by GermanSani »

Another update that again adds some new things:

- The Stick-Mouse is now toggleable (and the toggling of the toggling is toggleable (yep, that sentence sounds weird but that's the accurate description ^^) as well so you can also till use the Stick while pressing the GyroOff-Button)

- The Nunchuck-Shake can be replaced by tilting the Nunchuck to the left and right, each for an input

- Added the NCStickOuterRing-Option, that allows to simualte a button press as soon as you reach the edges with the Nunchuck-Stick

- The duration, for how long you have to press the 1 + 2 buttons until recalibration starts, is now customizable

- The sensitivity of the Nunchuck-Stick for pressing keys can be adjusted

- Nunchuck-Buttons can be used for Mouse-Buttons

- Tilting the Wiimote left / right can now also be mapped to keys

- Scrolling with the Mouse-Wheel can now also be done when tilting the Nunchuck

GermanSani
One Eyed Hopeful
Posts: 7
Joined: Sun Feb 28, 2021 8:44 am

Re: Wiimote Script inspired by JSM

Post by GermanSani »

Version 1.6:

- Added the possibility to use the Nunchuck of a second connected Wiimote instead of one attached to the Wiimote that also simulates the GyroMouse.
This makes the GyroMouse much smoother as FreePIE doesn't need to switch between MotionPlus and Nunchuck constantly anymore.

If you know another solution with preferably not having to use a second Wiimote I'd be happy to hear about it. :)

- Fixed a Problem that prevented disabling the Nunchuck

Post Reply

Return to “FreePIE”