• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Controllers v
« Previous 1 … 244 245 246 247 248 … 322 Next »

How to control 3rd party Wiimote
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
How to control 3rd party Wiimote
10-14-2012, 06:45 PM (This post was last modified: 10-14-2012, 06:58 PM by yldza.)
#1
yldza Offline
Junior Member
**
Posts: 5
Threads: 1
Joined: Oct 2012
Exclamation 
Hi,

I bought a 3rd party Wiimote and want to use it to control my PC. I don't know too much about the way that I need to follow. For example, should I use a USB dongle for Bluetooth communication and a separate Bluetooth software stack?

Could you help me about this? Thank you.

P.S.: I forgot to say that I tested the device with a Linux distribution and I checked that it works.
Find
Reply
10-14-2012, 06:59 PM
#2
admin89 Offline
Overclocker™ ✓ᵛᵉʳᶦᶠᶦᵉᵈ
*******
Posts: 6,889
Threads: 127
Joined: Nov 2009
Hint : Glovepie + Write a script
Laptop:
Clevo W230SS : 3200x1800 IPS | i7 4700MQ @ 3.6GHz (Intel XTU + Triple fan mod) | GTX 860M GDDR5 | 128GB Toshiba CFD SSD | 16GB DDR3L 1600MHz
Aspire 715 43G : 1080p 144Hz |  R5 5625U @ 4.3GHz | Nvidia RTX 3050 4GB | 500GB WD SSD  | 16GB DDR4 3200MHz 
Mini PC ::
G3258 @ 4.6GHz | ELSA GTX 750 | Asrock Z87E ITX | 600W SFX 80+ Gold Silverstone + SG06-LITE | Corsair Vengeance 8GB 2000MHz | Scythe Kozuti + Ao Kaze | 45TB 2.5" Ex HDD (in total) , Zelda Gold Wiimote , LE Wii Classic Controller , Gold LE PS3 DualShock , BlackWidow Chroma ,
Now Playing : Xenoblade Definitive Edition on Yuzu - Switch Emu 

 
Find
Reply
10-14-2012, 07:18 PM
#3
yldza Offline
Junior Member
**
Posts: 5
Threads: 1
Joined: Oct 2012
(10-14-2012, 06:59 PM)admin89 Wrote: Hint : Glovepie + Write a script

It says Nintendo RVL-CNT-01 is connected but after a while it disconnects. I try to run a script on GlovePIE and anything happens. Which script should work?

Thank you.
Find
Reply
10-14-2012, 07:31 PM (This post was last modified: 10-14-2012, 07:38 PM by admin89.)
#4
admin89 Offline
Overclocker™ ✓ᵛᵉʳᶦᶠᶦᵉᵈ
*******
Posts: 6,889
Threads: 127
Joined: Nov 2009
Well ... Your question is not clear
What kind of "control" do you want ?
There are many types of scripts like : Wiimote -> GC controller , Wiimote -> PC game controller , Wiimote -> Mouse ....
Quote: I forgot to say that I tested the device with a Linux distribution
Sorry i don't use Linux . So i'm not sure the script will work or not

Quote:3rd party Wiimote
Not recommend for Dolphin . 3rd party / fake wiimote is either :
_Not work at all
_Work but you will have issue with it (randomly disconnect or can't see the pointer or button doesn't work when you press it )
Edit : Some 3rd party wiimote will work perfectly with dolphin if you're lucky

Laptop:
Clevo W230SS : 3200x1800 IPS | i7 4700MQ @ 3.6GHz (Intel XTU + Triple fan mod) | GTX 860M GDDR5 | 128GB Toshiba CFD SSD | 16GB DDR3L 1600MHz
Aspire 715 43G : 1080p 144Hz |  R5 5625U @ 4.3GHz | Nvidia RTX 3050 4GB | 500GB WD SSD  | 16GB DDR4 3200MHz 
Mini PC ::
G3258 @ 4.6GHz | ELSA GTX 750 | Asrock Z87E ITX | 600W SFX 80+ Gold Silverstone + SG06-LITE | Corsair Vengeance 8GB 2000MHz | Scythe Kozuti + Ao Kaze | 45TB 2.5" Ex HDD (in total) , Zelda Gold Wiimote , LE Wii Classic Controller , Gold LE PS3 DualShock , BlackWidow Chroma ,
Now Playing : Xenoblade Definitive Edition on Yuzu - Switch Emu 

 
Find
Reply
10-14-2012, 07:42 PM (This post was last modified: 10-14-2012, 07:49 PM by yldza.)
#5
yldza Offline
Junior Member
**
Posts: 5
Threads: 1
Joined: Oct 2012
(10-14-2012, 07:31 PM)admin89 Wrote: Well ... Your question is not clear
What kind of "control" do you want ?
There are many types of scripts like : Wiimote -> GC controller , Wiimote -> PC game controller , Wiimote -> Mouse ....
Quote: I forgot to say that I tested the device with a Linux distribution
Sorry i don't use Linux . So i'm not sure the script will work or not

Quote:3rd party Wiimote
Not recommend for Dolphin . 3rd party / fake wiimote is either :
_Not work at all
_Work but you will have issue with it (randomly disconnect or can't see the pointer or button doesn't work when you press it )

Thank you for your help.

I just want to use it as a mouse pointer at first.
Find
Reply
10-14-2012, 07:54 PM (This post was last modified: 10-14-2012, 07:55 PM by admin89.)
#6
admin89 Offline
Overclocker™ ✓ᵛᵉʳᶦᶠᶦᵉᵈ
*******
Posts: 6,889
Threads: 127
Joined: Nov 2009
You will need to spend money for that and i can't guarantee it will work either
What kind of wiimote do you have ? Normal Wiimote or Wiimote Plus (Wiimote plus = wiimote + built in motion plus)
Do you have a sensor bar ?

Wii Remote + Sensor bar
Code:
// Wiimote mouse script for Windows desktop
// Requires a sensor bar

var.ButtonFreezeTime = 250ms
var.PointerBump = KeepDown(Pressed(wiimote.A),var.ButtonFreezeTime) or KeepDown(Pressed(wiimote.B),var.ButtonFreezeTime)
wiimote.Leds = false

// Mouse movement
if wiimote.PointerVisible but not var.PointerBump then
  mouse.x = wiimote.PointerX
  mouse.y = wiimote.PointerY
end if

// Mouse and Keyboard Buttons
mouse.LeftButton = Wiimote.A and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.RightButton = Wiimote.B and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.MiddleButton = Wiimote.Home and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.XButton1 = Wiimote.Minus
mouse.XButton2 = Wiimote.Plus
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
Keyboard.Escape = Wiimote.Two
Keyboard.Windows = Wiimote.One
// Mouse Wheel
if wiimote.Up then
  mouse.WheelUp = true
  wait 30ms
  mouse.WheelUp = false
  wait 30ms
end if
if wiimote.Down then
  mouse.WheelDown = true
  wait 30ms
  mouse.WheelDown = false
  wait 30ms
end if

Wii Remote Plus :

Code:
/*
    WiiMotion Plus Mouse                              


    Emulates the basic functionality of a Gyration Air Mouse.
    Requires GlovePIE version .42 or higher.

*/

// ==== Buttons ================================================================
var.MoveButton = wiimote.B
mouse.LeftButton = wiimote.A
mouse.RightButton = wiimote.Plus
Keyboard.Enter = wiimote.Minus
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
Keyboard.Up = Wiimote.Up
Keyboard.Down = Wiimote.Down
Keyboard.BackSpace = Wiimote.Home
Keyboard.Windows = Wiimote.Two
Keyboard.Tab = Wiimote.One
Wiimote.Led1 = False

// ==== Options ================================================================
var.HoldToMove = true
// true = Hold MoveButton to move
// false = Hold MoveButton to stop, flip Wiimote upside-down to use normal mouse

var.EdgeStop = true
// Stops movement at the edge of the screen

var.Speed = 80  // 0 to 100
// Overall speed of movement

var.Mouse_Precision = 7.5 // 0 to 15
// Low values smooth the movement of the cursor

PIE.FrameRate = 100hz  // Wii MotionPlus has a refresh rate of 100hz

// ==== Wii MotionPlus =========================================================
// Start of Wii Motion Plus script
IF HeldDown(abs(wiimote.SmoothRoll)>135, 1 second) THEN var.WiimoteUpsideDown = true ELSE var.WiimoteUpsideDown = false
IF var.HoldToMove = true {
   var.Move = var.MoveButton
ELSE
   IF var.MoveButton = false AND var.WiimoteUpsideDown = false THEN var.Move = true ELSE var.Move = false
}
IF wiimote.HasMotionPlus = false THEN var.CalibDebug = "[ WiiMotion Plus NOT DETECTED! ]" ELSE var.CalibDebug = ""
IF wiimote.HasMotionPlus = true AND var.Move = true {
   var.YawSpeed = wiimote.MotionPlus.YawSpeed
   var.PitchSpeed = wiimote.MotionPlus.PitchSpeed
   IF SameValue( Smooth(wiimote.Roll, 30), wiimote.Roll, 50) THEN var.Roll = Smooth(wiimote.Roll, 30) ELSE var.Roll = wiimote.Roll
   IF var.Roll < 0 AND var.Roll >= -90 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, 0, 0, 1)
      var.RightDown = -1
      var.TopUp = 1
   }
   IF var.Roll <= 90 AND var.Roll >= 0 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 0, 0, 1)
      var.RightDown = 1
      var.TopUp = 1
   }
   IF var.Roll > 90 AND var.Roll <= 180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 180, 0, 1)
      var.RightDown = 1
      var.TopUp = -1
   }
   IF var.Roll < -90 AND var.Roll >= -180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, -180, 0, 1)
      var.RightDown = -1
      var.TopUp = -1
   }
   var.TopUpFix = Smooth(var.TopUp,30) / abs(Smooth(var.TopUp,30))
   var.RightDownFix = Smooth(var.RightDown,30) / abs(Smooth(var.RightDown,30))
   var.SpeedX = var.TopUpFix * var.YawSpeed - ( var.TopUpFix * var.YawSpeed * var.XYswap ) + ( var.RightDownFix * var.PitchSpeed * var.XYswap )
   var.SpeedY = var.TopUpFix * var.PitchSpeed - ( var.TopUpFix * var.PitchSpeed * var.XYswap) + ( -var.RightDownFix * var.YawSpeed * var.XYswap )
   var.Mouse_X = var.Mouse_X + ( var.SpeedX / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
   var.Mouse_Y = var.Mouse_Y - ( var.SpeedY / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
}
IF var.Move = false {
   IF delta(var.Move) = true {
      var.Mouse_X = var.CursorX
      var.Mouse_Y = var.CursorY
   }
   var.Mouse_X = mouse.x
   var.Mouse_Y = mouse.y
ELSE
   IF var.EdgeStop = true {
      var.Mouse_X = EnsureRange(var.Mouse_X, 0, 1)
      var.Mouse_Y = EnsureRange(var.Mouse_Y, 0, 1)
   }
   mouse.x = var.CursorX
   mouse.y = var.CursorY
   IF delta(var.Move) = true {
      var.Mouse_X = var.CursorX
      var.Mouse_Y = var.CursorY
   }
}

// ==== Dynamic Motion Smoothing ===============================================
//  This automatically adjusts the smoothness
//  of the movement based on the cursor's speed.
var.Mouse_Speed_X = int(abs(delta(var.Mouse_X))*1000)
var.Mouse_Speed_Y = int(abs(delta(var.Mouse_Y))*1000)
var.Mouse_Speed_XY = int(sqrt(var.Mouse_Speed_X + var.Mouse_Speed_Y) * var.Mouse_Precision)
IF var.Mouse_Speed_XY >= 30 THEN var.Mouse_SmoothHold = 0 ELSE var.Mouse_SmoothHold = 30 - var.Mouse_Speed_XY
var.Mouse_SmoothLimit = 30 - EnsureRange(var.Mouse_Precision*2, 0, 30)
IF var.Mouse_SmoothHold < var.Mouse_Smooth THEN var.Mouse_Smooth = var.Mouse_Smooth - (1 + int(EnsureMapRange(var.Mouse_SmoothHold, 0, 30, 30, 0)))
IF var.Mouse_SmoothHold > var.Mouse_Smooth OR (var.Mouse_SmoothHold = 30 AND var.Mouse_Smooth <= 29) {
   wait EnsureMapRange(var.Mouse_Smooth, 0, 29, 0, 100)ms
   IF var.Mouse_Smooth < var.Mouse_SmoothLimit THEN var.Mouse_Smooth++
}
IF var.Mouse_Smooth <= 0 THEN var.Mouse_Smooth = 0
IF var.Mouse_Smooth <= 0 THEN var.CursorX = var.Mouse_X
IF var.Mouse_Smooth <= 0 THEN var.CursorY = var.Mouse_Y
IF var.Mouse_Smooth = 1 THEN var.CursorX = Smooth(var.Mouse_X, 1)
IF var.Mouse_Smooth = 1 THEN var.CursorY = Smooth(var.Mouse_Y, 1)
IF var.Mouse_Smooth = 2 THEN var.CursorX = Smooth(var.Mouse_X, 2)
IF var.Mouse_Smooth = 2 THEN var.CursorY = Smooth(var.Mouse_Y, 2)
IF var.Mouse_Smooth = 3 THEN var.CursorX = Smooth(var.Mouse_X, 3)
IF var.Mouse_Smooth = 3 THEN var.CursorY = Smooth(var.Mouse_Y, 3)
IF var.Mouse_Smooth = 4 THEN var.CursorX = Smooth(var.Mouse_X, 4)
IF var.Mouse_Smooth = 4 THEN var.CursorY = Smooth(var.Mouse_Y, 4)
IF var.Mouse_Smooth = 5 THEN var.CursorX = Smooth(var.Mouse_X, 5)
IF var.Mouse_Smooth = 5 THEN var.CursorY = Smooth(var.Mouse_Y, 5)
IF var.Mouse_Smooth = 6 THEN var.CursorX = Smooth(var.Mouse_X, 6)
IF var.Mouse_Smooth = 6 THEN var.CursorY = Smooth(var.Mouse_Y, 6)
IF var.Mouse_Smooth = 7 THEN var.CursorX = Smooth(var.Mouse_X, 7)
IF var.Mouse_Smooth = 7 THEN var.CursorY = Smooth(var.Mouse_Y, 7)
IF var.Mouse_Smooth = 8 THEN var.CursorX = Smooth(var.Mouse_X, 8)
IF var.Mouse_Smooth = 8 THEN var.CursorY = Smooth(var.Mouse_Y, 8)
IF var.Mouse_Smooth = 9 THEN var.CursorX = Smooth(var.Mouse_X, 9)
IF var.Mouse_Smooth = 9 THEN var.CursorY = Smooth(var.Mouse_Y, 9)
IF var.Mouse_Smooth = 10 THEN var.CursorX = Smooth(var.Mouse_X, 10)
IF var.Mouse_Smooth = 10 THEN var.CursorY = Smooth(var.Mouse_Y, 10)
IF var.Mouse_Smooth = 11 THEN var.CursorX = Smooth(var.Mouse_X, 11)
IF var.Mouse_Smooth = 11 THEN var.CursorY = Smooth(var.Mouse_Y, 11)
IF var.Mouse_Smooth = 12 THEN var.CursorX = Smooth(var.Mouse_X, 12)
IF var.Mouse_Smooth = 12 THEN var.CursorY = Smooth(var.Mouse_Y, 12)
IF var.Mouse_Smooth = 13 THEN var.CursorX = Smooth(var.Mouse_X, 13)
IF var.Mouse_Smooth = 13 THEN var.CursorY = Smooth(var.Mouse_Y, 13)
IF var.Mouse_Smooth = 14 THEN var.CursorX = Smooth(var.Mouse_X, 14)
IF var.Mouse_Smooth = 14 THEN var.CursorY = Smooth(var.Mouse_Y, 14)
IF var.Mouse_Smooth = 15 THEN var.CursorX = Smooth(var.Mouse_X, 15)
IF var.Mouse_Smooth = 15 THEN var.CursorY = Smooth(var.Mouse_Y, 15)
IF var.Mouse_Smooth = 16 THEN var.CursorX = Smooth(var.Mouse_X, 16)
IF var.Mouse_Smooth = 16 THEN var.CursorY = Smooth(var.Mouse_Y, 16)
IF var.Mouse_Smooth = 17 THEN var.CursorX = Smooth(var.Mouse_X, 17)
IF var.Mouse_Smooth = 17 THEN var.CursorY = Smooth(var.Mouse_Y, 17)
IF var.Mouse_Smooth = 18 THEN var.CursorX = Smooth(var.Mouse_X, 18)
IF var.Mouse_Smooth = 18 THEN var.CursorY = Smooth(var.Mouse_Y, 18)
IF var.Mouse_Smooth = 19 THEN var.CursorX = Smooth(var.Mouse_X, 19)
IF var.Mouse_Smooth = 19 THEN var.CursorY = Smooth(var.Mouse_Y, 19)
IF var.Mouse_Smooth = 20 THEN var.CursorX = Smooth(var.Mouse_X, 20)
IF var.Mouse_Smooth = 20 THEN var.CursorY = Smooth(var.Mouse_Y, 20)
IF var.Mouse_Smooth = 21 THEN var.CursorX = Smooth(var.Mouse_X, 21)
IF var.Mouse_Smooth = 21 THEN var.CursorY = Smooth(var.Mouse_Y, 21)
IF var.Mouse_Smooth = 22 THEN var.CursorX = Smooth(var.Mouse_X, 22)
IF var.Mouse_Smooth = 22 THEN var.CursorY = Smooth(var.Mouse_Y, 22)
IF var.Mouse_Smooth = 23 THEN var.CursorX = Smooth(var.Mouse_X, 23)
IF var.Mouse_Smooth = 23 THEN var.CursorY = Smooth(var.Mouse_Y, 23)
IF var.Mouse_Smooth = 24 THEN var.CursorX = Smooth(var.Mouse_X, 24)
IF var.Mouse_Smooth = 24 THEN var.CursorY = Smooth(var.Mouse_Y, 24)
IF var.Mouse_Smooth = 25 THEN var.CursorX = Smooth(var.Mouse_X, 25)
IF var.Mouse_Smooth = 25 THEN var.CursorY = Smooth(var.Mouse_Y, 25)
IF var.Mouse_Smooth = 26 THEN var.CursorX = Smooth(var.Mouse_X, 26)
IF var.Mouse_Smooth = 26 THEN var.CursorY = Smooth(var.Mouse_Y, 26)
IF var.Mouse_Smooth = 27 THEN var.CursorX = Smooth(var.Mouse_X, 27)
IF var.Mouse_Smooth = 27 THEN var.CursorY = Smooth(var.Mouse_Y, 27)
IF var.Mouse_Smooth = 28 THEN var.CursorX = Smooth(var.Mouse_X, 28)
IF var.Mouse_Smooth = 28 THEN var.CursorY = Smooth(var.Mouse_Y, 28)
IF var.Mouse_Smooth = 29 THEN var.CursorX = Smooth(var.Mouse_X, 29)
IF var.Mouse_Smooth = 29 THEN var.CursorY = Smooth(var.Mouse_Y, 29)
IF var.Mouse_Smooth >= 30 THEN var.CursorX = Smooth(var.Mouse_X, 30)
IF var.Mouse_Smooth >= 30 THEN var.CursorY = Smooth(var.Mouse_Y, 30)

// ==== Wiimote Battery Test  =================================================
// Fills up with blinking LEDs to 50%
// then fills with solid LEDs to 100%
if var.BatteryDebug = false then var.BatteryDebug = ""
if var.BatteryTestButton = true and var.BatteryDisplayOn != true {
   wiimote.Report15 = 0x80 | int(wiimote.Rumble)
   var.BatteryLevel = wiimote.Battery
   var.BatteryDebug = " [ Battery : "+(int(var.BatteryLevel/1.92))+"% ] "
   var.BatteryLEDs = 0
   var.BatteryLEDbefore = wiimote.LEDs
   var.BatteryDisplayOn = true
}
if var.BatteryDisplayOn = true {
   if var.BatteryLEDs <= var.BatteryLevel {
      var.BatteryLEDs = var.BatteryLEDs + 12
      wait 60ms
   else
      wait 1000ms
      var.BatteryDisplayOn = "done"
   }
   if var.BatteryLEDs <= 96 {
      var.BatteryLED_A = 0
      if var.BatteryLEDs <= 24 then var.BatteryLED_B = 1
      if var.BatteryLEDs > 24 and var.BatteryLEDs <= 48 then var.BatteryLED_B = 3
      if var.BatteryLEDs > 48 and var.BatteryLEDs <= 72 then var.BatteryLED_B = 7
      if var.BatteryLEDs > 72 then var.BatteryLED_B = 15
   else
      if var.BatteryLEDs <= 120 then var.BatteryLED_A = 1
      if var.BatteryLEDs > 120 and var.BatteryLEDs <= 144 then var.BatteryLED_A = 3
      if var.BatteryLEDs > 144 and var.BatteryLEDs <= 168 then var.BatteryLED_A = 7
      if var.BatteryLEDs > 168 then var.BatteryLED_A = 15
   }
   wiimote.LEDs = var.BatteryLED_A
   wait 40ms
   wiimote.LEDs = var.BatteryLED_B
   wait 20ms
elseif var.BatteryDisplayOn = "done"
   wiimote.LEDs = 0
   wait 2 seconds
   wiimote.LEDs = var.BatteryLEDbefore
   var.BatteryDisplayOn = false
}

debug = var.CalibDebug + var.DebugPrecision + var.DebugSmooth + var.BatteryDebug
var.DebugPrecision = " [ Precision: "+ var.Mouse_Precision +" ]"
var.DebugSmooth = " [ Smooth: "+ int(var.Mouse_Smooth) +" ]"
Laptop:
Clevo W230SS : 3200x1800 IPS | i7 4700MQ @ 3.6GHz (Intel XTU + Triple fan mod) | GTX 860M GDDR5 | 128GB Toshiba CFD SSD | 16GB DDR3L 1600MHz
Aspire 715 43G : 1080p 144Hz |  R5 5625U @ 4.3GHz | Nvidia RTX 3050 4GB | 500GB WD SSD  | 16GB DDR4 3200MHz 
Mini PC ::
G3258 @ 4.6GHz | ELSA GTX 750 | Asrock Z87E ITX | 600W SFX 80+ Gold Silverstone + SG06-LITE | Corsair Vengeance 8GB 2000MHz | Scythe Kozuti + Ao Kaze | 45TB 2.5" Ex HDD (in total) , Zelda Gold Wiimote , LE Wii Classic Controller , Gold LE PS3 DualShock , BlackWidow Chroma ,
Now Playing : Xenoblade Definitive Edition on Yuzu - Switch Emu 

 
Find
Reply
10-14-2012, 08:01 PM
#7
yldza Offline
Junior Member
**
Posts: 5
Threads: 1
Joined: Oct 2012
(10-14-2012, 07:54 PM)admin89 Wrote: You will need to spend money for that and i can't guarantee it will work either
What kind of wiimote do you have ? Normal Wiimote or Wiimote Plus (Wiimote plus = wiimote + built in motion plus)
Do you have a sensor bar ?

Wii Remote + Sensor bar
Code:
// Wiimote mouse script for Windows desktop
// Requires a sensor bar

var.ButtonFreezeTime = 250ms
var.PointerBump = KeepDown(Pressed(wiimote.A),var.ButtonFreezeTime) or KeepDown(Pressed(wiimote.B),var.ButtonFreezeTime)
wiimote.Leds = false

// Mouse movement
if wiimote.PointerVisible but not var.PointerBump then
  mouse.x = wiimote.PointerX
  mouse.y = wiimote.PointerY
end if

// Mouse and Keyboard Buttons
mouse.LeftButton = Wiimote.A and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.RightButton = Wiimote.B and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.MiddleButton = Wiimote.Home and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.XButton1 = Wiimote.Minus
mouse.XButton2 = Wiimote.Plus
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
Keyboard.Escape = Wiimote.Two
Keyboard.Windows = Wiimote.One
// Mouse Wheel
if wiimote.Up then
  mouse.WheelUp = true
  wait 30ms
  mouse.WheelUp = false
  wait 30ms
end if
if wiimote.Down then
  mouse.WheelDown = true
  wait 30ms
  mouse.WheelDown = false
  wait 30ms
end if

Wii Remote Plus :

Code:
/*
    WiiMotion Plus Mouse                              


    Emulates the basic functionality of a Gyration Air Mouse.
    Requires GlovePIE version .42 or higher.

*/

// ==== Buttons ================================================================
var.MoveButton = wiimote.B
mouse.LeftButton = wiimote.A
mouse.RightButton = wiimote.Plus
Keyboard.Enter = wiimote.Minus
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
Keyboard.Up = Wiimote.Up
Keyboard.Down = Wiimote.Down
Keyboard.BackSpace = Wiimote.Home
Keyboard.Windows = Wiimote.Two
Keyboard.Tab = Wiimote.One
Wiimote.Led1 = False

// ==== Options ================================================================
var.HoldToMove = true
// true = Hold MoveButton to move
// false = Hold MoveButton to stop, flip Wiimote upside-down to use normal mouse

var.EdgeStop = true
// Stops movement at the edge of the screen

var.Speed = 80  // 0 to 100
// Overall speed of movement

var.Mouse_Precision = 7.5 // 0 to 15
// Low values smooth the movement of the cursor

PIE.FrameRate = 100hz  // Wii MotionPlus has a refresh rate of 100hz

// ==== Wii MotionPlus =========================================================
// Start of Wii Motion Plus script
IF HeldDown(abs(wiimote.SmoothRoll)>135, 1 second) THEN var.WiimoteUpsideDown = true ELSE var.WiimoteUpsideDown = false
IF var.HoldToMove = true {
   var.Move = var.MoveButton
ELSE
   IF var.MoveButton = false AND var.WiimoteUpsideDown = false THEN var.Move = true ELSE var.Move = false
}
IF wiimote.HasMotionPlus = false THEN var.CalibDebug = "[ WiiMotion Plus NOT DETECTED! ]" ELSE var.CalibDebug = ""
IF wiimote.HasMotionPlus = true AND var.Move = true {
   var.YawSpeed = wiimote.MotionPlus.YawSpeed
   var.PitchSpeed = wiimote.MotionPlus.PitchSpeed
   IF SameValue( Smooth(wiimote.Roll, 30), wiimote.Roll, 50) THEN var.Roll = Smooth(wiimote.Roll, 30) ELSE var.Roll = wiimote.Roll
   IF var.Roll < 0 AND var.Roll >= -90 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, 0, 0, 1)
      var.RightDown = -1
      var.TopUp = 1
   }
   IF var.Roll <= 90 AND var.Roll >= 0 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 0, 0, 1)
      var.RightDown = 1
      var.TopUp = 1
   }
   IF var.Roll > 90 AND var.Roll <= 180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 180, 0, 1)
      var.RightDown = 1
      var.TopUp = -1
   }
   IF var.Roll < -90 AND var.Roll >= -180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, -180, 0, 1)
      var.RightDown = -1
      var.TopUp = -1
   }
   var.TopUpFix = Smooth(var.TopUp,30) / abs(Smooth(var.TopUp,30))
   var.RightDownFix = Smooth(var.RightDown,30) / abs(Smooth(var.RightDown,30))
   var.SpeedX = var.TopUpFix * var.YawSpeed - ( var.TopUpFix * var.YawSpeed * var.XYswap ) + ( var.RightDownFix * var.PitchSpeed * var.XYswap )
   var.SpeedY = var.TopUpFix * var.PitchSpeed - ( var.TopUpFix * var.PitchSpeed * var.XYswap) + ( -var.RightDownFix * var.YawSpeed * var.XYswap )
   var.Mouse_X = var.Mouse_X + ( var.SpeedX / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
   var.Mouse_Y = var.Mouse_Y - ( var.SpeedY / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
}
IF var.Move = false {
   IF delta(var.Move) = true {
      var.Mouse_X = var.CursorX
      var.Mouse_Y = var.CursorY
   }
   var.Mouse_X = mouse.x
   var.Mouse_Y = mouse.y
ELSE
   IF var.EdgeStop = true {
      var.Mouse_X = EnsureRange(var.Mouse_X, 0, 1)
      var.Mouse_Y = EnsureRange(var.Mouse_Y, 0, 1)
   }
   mouse.x = var.CursorX
   mouse.y = var.CursorY
   IF delta(var.Move) = true {
      var.Mouse_X = var.CursorX
      var.Mouse_Y = var.CursorY
   }
}

// ==== Dynamic Motion Smoothing ===============================================
//  This automatically adjusts the smoothness
//  of the movement based on the cursor's speed.
var.Mouse_Speed_X = int(abs(delta(var.Mouse_X))*1000)
var.Mouse_Speed_Y = int(abs(delta(var.Mouse_Y))*1000)
var.Mouse_Speed_XY = int(sqrt(var.Mouse_Speed_X + var.Mouse_Speed_Y) * var.Mouse_Precision)
IF var.Mouse_Speed_XY >= 30 THEN var.Mouse_SmoothHold = 0 ELSE var.Mouse_SmoothHold = 30 - var.Mouse_Speed_XY
var.Mouse_SmoothLimit = 30 - EnsureRange(var.Mouse_Precision*2, 0, 30)
IF var.Mouse_SmoothHold < var.Mouse_Smooth THEN var.Mouse_Smooth = var.Mouse_Smooth - (1 + int(EnsureMapRange(var.Mouse_SmoothHold, 0, 30, 30, 0)))
IF var.Mouse_SmoothHold > var.Mouse_Smooth OR (var.Mouse_SmoothHold = 30 AND var.Mouse_Smooth <= 29) {
   wait EnsureMapRange(var.Mouse_Smooth, 0, 29, 0, 100)ms
   IF var.Mouse_Smooth < var.Mouse_SmoothLimit THEN var.Mouse_Smooth++
}
IF var.Mouse_Smooth <= 0 THEN var.Mouse_Smooth = 0
IF var.Mouse_Smooth <= 0 THEN var.CursorX = var.Mouse_X
IF var.Mouse_Smooth <= 0 THEN var.CursorY = var.Mouse_Y
IF var.Mouse_Smooth = 1 THEN var.CursorX = Smooth(var.Mouse_X, 1)
IF var.Mouse_Smooth = 1 THEN var.CursorY = Smooth(var.Mouse_Y, 1)
IF var.Mouse_Smooth = 2 THEN var.CursorX = Smooth(var.Mouse_X, 2)
IF var.Mouse_Smooth = 2 THEN var.CursorY = Smooth(var.Mouse_Y, 2)
IF var.Mouse_Smooth = 3 THEN var.CursorX = Smooth(var.Mouse_X, 3)
IF var.Mouse_Smooth = 3 THEN var.CursorY = Smooth(var.Mouse_Y, 3)
IF var.Mouse_Smooth = 4 THEN var.CursorX = Smooth(var.Mouse_X, 4)
IF var.Mouse_Smooth = 4 THEN var.CursorY = Smooth(var.Mouse_Y, 4)
IF var.Mouse_Smooth = 5 THEN var.CursorX = Smooth(var.Mouse_X, 5)
IF var.Mouse_Smooth = 5 THEN var.CursorY = Smooth(var.Mouse_Y, 5)
IF var.Mouse_Smooth = 6 THEN var.CursorX = Smooth(var.Mouse_X, 6)
IF var.Mouse_Smooth = 6 THEN var.CursorY = Smooth(var.Mouse_Y, 6)
IF var.Mouse_Smooth = 7 THEN var.CursorX = Smooth(var.Mouse_X, 7)
IF var.Mouse_Smooth = 7 THEN var.CursorY = Smooth(var.Mouse_Y, 7)
IF var.Mouse_Smooth = 8 THEN var.CursorX = Smooth(var.Mouse_X, 8)
IF var.Mouse_Smooth = 8 THEN var.CursorY = Smooth(var.Mouse_Y, 8)
IF var.Mouse_Smooth = 9 THEN var.CursorX = Smooth(var.Mouse_X, 9)
IF var.Mouse_Smooth = 9 THEN var.CursorY = Smooth(var.Mouse_Y, 9)
IF var.Mouse_Smooth = 10 THEN var.CursorX = Smooth(var.Mouse_X, 10)
IF var.Mouse_Smooth = 10 THEN var.CursorY = Smooth(var.Mouse_Y, 10)
IF var.Mouse_Smooth = 11 THEN var.CursorX = Smooth(var.Mouse_X, 11)
IF var.Mouse_Smooth = 11 THEN var.CursorY = Smooth(var.Mouse_Y, 11)
IF var.Mouse_Smooth = 12 THEN var.CursorX = Smooth(var.Mouse_X, 12)
IF var.Mouse_Smooth = 12 THEN var.CursorY = Smooth(var.Mouse_Y, 12)
IF var.Mouse_Smooth = 13 THEN var.CursorX = Smooth(var.Mouse_X, 13)
IF var.Mouse_Smooth = 13 THEN var.CursorY = Smooth(var.Mouse_Y, 13)
IF var.Mouse_Smooth = 14 THEN var.CursorX = Smooth(var.Mouse_X, 14)
IF var.Mouse_Smooth = 14 THEN var.CursorY = Smooth(var.Mouse_Y, 14)
IF var.Mouse_Smooth = 15 THEN var.CursorX = Smooth(var.Mouse_X, 15)
IF var.Mouse_Smooth = 15 THEN var.CursorY = Smooth(var.Mouse_Y, 15)
IF var.Mouse_Smooth = 16 THEN var.CursorX = Smooth(var.Mouse_X, 16)
IF var.Mouse_Smooth = 16 THEN var.CursorY = Smooth(var.Mouse_Y, 16)
IF var.Mouse_Smooth = 17 THEN var.CursorX = Smooth(var.Mouse_X, 17)
IF var.Mouse_Smooth = 17 THEN var.CursorY = Smooth(var.Mouse_Y, 17)
IF var.Mouse_Smooth = 18 THEN var.CursorX = Smooth(var.Mouse_X, 18)
IF var.Mouse_Smooth = 18 THEN var.CursorY = Smooth(var.Mouse_Y, 18)
IF var.Mouse_Smooth = 19 THEN var.CursorX = Smooth(var.Mouse_X, 19)
IF var.Mouse_Smooth = 19 THEN var.CursorY = Smooth(var.Mouse_Y, 19)
IF var.Mouse_Smooth = 20 THEN var.CursorX = Smooth(var.Mouse_X, 20)
IF var.Mouse_Smooth = 20 THEN var.CursorY = Smooth(var.Mouse_Y, 20)
IF var.Mouse_Smooth = 21 THEN var.CursorX = Smooth(var.Mouse_X, 21)
IF var.Mouse_Smooth = 21 THEN var.CursorY = Smooth(var.Mouse_Y, 21)
IF var.Mouse_Smooth = 22 THEN var.CursorX = Smooth(var.Mouse_X, 22)
IF var.Mouse_Smooth = 22 THEN var.CursorY = Smooth(var.Mouse_Y, 22)
IF var.Mouse_Smooth = 23 THEN var.CursorX = Smooth(var.Mouse_X, 23)
IF var.Mouse_Smooth = 23 THEN var.CursorY = Smooth(var.Mouse_Y, 23)
IF var.Mouse_Smooth = 24 THEN var.CursorX = Smooth(var.Mouse_X, 24)
IF var.Mouse_Smooth = 24 THEN var.CursorY = Smooth(var.Mouse_Y, 24)
IF var.Mouse_Smooth = 25 THEN var.CursorX = Smooth(var.Mouse_X, 25)
IF var.Mouse_Smooth = 25 THEN var.CursorY = Smooth(var.Mouse_Y, 25)
IF var.Mouse_Smooth = 26 THEN var.CursorX = Smooth(var.Mouse_X, 26)
IF var.Mouse_Smooth = 26 THEN var.CursorY = Smooth(var.Mouse_Y, 26)
IF var.Mouse_Smooth = 27 THEN var.CursorX = Smooth(var.Mouse_X, 27)
IF var.Mouse_Smooth = 27 THEN var.CursorY = Smooth(var.Mouse_Y, 27)
IF var.Mouse_Smooth = 28 THEN var.CursorX = Smooth(var.Mouse_X, 28)
IF var.Mouse_Smooth = 28 THEN var.CursorY = Smooth(var.Mouse_Y, 28)
IF var.Mouse_Smooth = 29 THEN var.CursorX = Smooth(var.Mouse_X, 29)
IF var.Mouse_Smooth = 29 THEN var.CursorY = Smooth(var.Mouse_Y, 29)
IF var.Mouse_Smooth >= 30 THEN var.CursorX = Smooth(var.Mouse_X, 30)
IF var.Mouse_Smooth >= 30 THEN var.CursorY = Smooth(var.Mouse_Y, 30)

// ==== Wiimote Battery Test  =================================================
// Fills up with blinking LEDs to 50%
// then fills with solid LEDs to 100%
if var.BatteryDebug = false then var.BatteryDebug = ""
if var.BatteryTestButton = true and var.BatteryDisplayOn != true {
   wiimote.Report15 = 0x80 | int(wiimote.Rumble)
   var.BatteryLevel = wiimote.Battery
   var.BatteryDebug = " [ Battery : "+(int(var.BatteryLevel/1.92))+"% ] "
   var.BatteryLEDs = 0
   var.BatteryLEDbefore = wiimote.LEDs
   var.BatteryDisplayOn = true
}
if var.BatteryDisplayOn = true {
   if var.BatteryLEDs <= var.BatteryLevel {
      var.BatteryLEDs = var.BatteryLEDs + 12
      wait 60ms
   else
      wait 1000ms
      var.BatteryDisplayOn = "done"
   }
   if var.BatteryLEDs <= 96 {
      var.BatteryLED_A = 0
      if var.BatteryLEDs <= 24 then var.BatteryLED_B = 1
      if var.BatteryLEDs > 24 and var.BatteryLEDs <= 48 then var.BatteryLED_B = 3
      if var.BatteryLEDs > 48 and var.BatteryLEDs <= 72 then var.BatteryLED_B = 7
      if var.BatteryLEDs > 72 then var.BatteryLED_B = 15
   else
      if var.BatteryLEDs <= 120 then var.BatteryLED_A = 1
      if var.BatteryLEDs > 120 and var.BatteryLEDs <= 144 then var.BatteryLED_A = 3
      if var.BatteryLEDs > 144 and var.BatteryLEDs <= 168 then var.BatteryLED_A = 7
      if var.BatteryLEDs > 168 then var.BatteryLED_A = 15
   }
   wiimote.LEDs = var.BatteryLED_A
   wait 40ms
   wiimote.LEDs = var.BatteryLED_B
   wait 20ms
elseif var.BatteryDisplayOn = "done"
   wiimote.LEDs = 0
   wait 2 seconds
   wiimote.LEDs = var.BatteryLEDbefore
   var.BatteryDisplayOn = false
}

debug = var.CalibDebug + var.DebugPrecision + var.DebugSmooth + var.BatteryDebug
var.DebugPrecision = " [ Precision: "+ var.Mouse_Precision +" ]"
var.DebugSmooth = " [ Smooth: "+ int(var.Mouse_Smooth) +" ]"

I do not have any sensor bar hardware.

I bought a 3rd party Remote and Nunchuck Wireless Controller not a genuine Nintendo hardware.

Is it not possible to control a PC via Microsoft Bluetooth stack by using a Wiimote?
Find
Reply
10-14-2012, 08:16 PM (This post was last modified: 10-14-2012, 08:18 PM by admin89.)
#8
admin89 Offline
Overclocker™ ✓ᵛᵉʳᶦᶠᶦᵉᵈ
*******
Posts: 6,889
Threads: 127
Joined: Nov 2009
Err..Don't quote the whole post . It's annoying
You must have either sensor bar or motion plus
Otherwise you can't see the pointer
I guess your have a normal wiimote . 2 options for you :
_ Buy a wireless sensor bar and use the 1st script
_ Buy a wii motionplus accessory and use the 2nd script
[Image: wii-motionplus-accessory.jpg]

Btw, i recommend option 2
But if you have wiimote plus , you don't need motion plus . This is an original wiimote plus (Wii motion plus inside)
[Image: K0000157211.jpg]

Normal Wiimote don't have this line "Wii motion plus inside"

Laptop:
Clevo W230SS : 3200x1800 IPS | i7 4700MQ @ 3.6GHz (Intel XTU + Triple fan mod) | GTX 860M GDDR5 | 128GB Toshiba CFD SSD | 16GB DDR3L 1600MHz
Aspire 715 43G : 1080p 144Hz |  R5 5625U @ 4.3GHz | Nvidia RTX 3050 4GB | 500GB WD SSD  | 16GB DDR4 3200MHz 
Mini PC ::
G3258 @ 4.6GHz | ELSA GTX 750 | Asrock Z87E ITX | 600W SFX 80+ Gold Silverstone + SG06-LITE | Corsair Vengeance 8GB 2000MHz | Scythe Kozuti + Ao Kaze | 45TB 2.5" Ex HDD (in total) , Zelda Gold Wiimote , LE Wii Classic Controller , Gold LE PS3 DualShock , BlackWidow Chroma ,
Now Playing : Xenoblade Definitive Edition on Yuzu - Switch Emu 

 
Find
Reply
10-14-2012, 08:17 PM
#9
yldza Offline
Junior Member
**
Posts: 5
Threads: 1
Joined: Oct 2012
Thanks for help.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma