Rare Witch Roundtable Podcast
Go Back   The Rare Witch Project Forums > Gaming > Rare & Playtonic > Homebrew Games and Tools

Homebrew Games and Tools If you've created a trainer, texture editor, or a full-blown fangame we'd like to see it here. Show off your mad programming skills.

Reply
 
Thread Tools
  #1  
Old 1st September 2011, 04:53 PM
Nayib's Avatar
Nayib Nayib is offline
Formerly itmightbenayib
 
Join Date: Aug 2011
Location: Ancient Lake
Total Awards: 5
You're Appreciated! Mystery Three Mystery Two Chatterbox RWP Podcast 
Wiimote+Nunchuk Browsing Script (Made with GlovePIE 0.43)

Hello, RWP!

Using Bluetooth connection (with BlueSoleil drivers), GlovePIE v0.43, and my Wiimote+Nunchuk, I've written this script to use the Wiimote and Nunchuk as a mouse. It's mainly set for browsing online. Clicking, right-clicking, etc etc.

Code:
//Wiimote and Nunchuk Mouse Script
//by Nayib Pastrana

//Added this part as a test. Use number keys
//One through Four to test connection.
//Each number lights responding LED light
//on Wiimote.
Wiimote1.Led1 = Keyboard.One
Wiimote1.Led2 = Keyboard.Two
Wiimote1.Led3 = Keyboard.Three
Wiimote1.Led4 = Keyboard.Four

//Use Nunchuk Joystick to move cursor.
mouse.x += (DeadZone(Nunchuk.JoyX, 5%)/75)
mouse.y += (DeadZone(Nunchuk.JoyY, 5%)/75)

//Buttons 1 and 2 respond as
//Page Up and Page Down, respectively.
Keyboard.PageDown = Wiimote1.Two
Keyboard.PageUp = Wiimote1.One

//Click with A, Right-Click with C.
mouse.LeftButton = (Wiimote1.A)
mouse.RightButton = (Nunchuk.C)

//Mouse's middle button responds with B.
mouse.MiddleButton = (Wiimote.B)

//Nunchuk Z Button minimizes all windows.
Keyboard.Windows + Keyboard.D = Nunchuk.Z

//D-Pad is used in place of Arrow Keys
Keyboard.Up = Wiimote1.Up
Keyboard.Down = Wiimote1.Down
Keyboard.Left = Wiimote1.Left
Keyboard.Right = Wiimote1.Right

//Plus and Minus is used to zoom in and out.
Keyboard.Ctrl + Keyboard.Equals = Wiimote1.Plus
Keyboard.Ctrl + Keyboard.Minus = Wiimote1.Minus

//Tap the HOME button to open the start menu.
Keyboard.Windows = Wiimote1.Home

//This is the end of the script.
If you don't know, everything beginning with // is a comment, and I mainly use it to explain the controls I've set up with this script.
__________________
Twitch 🎮 | Twitter 🐦 | Discord 💬 | TT ⏲️
Reply With Quote


Reply


User Tag List


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:56 AM.


Forums powered by vBulletin® Copyright © Jelsoft Enterprises Ltd.
Website © 2000-∞ The RWP