GlovePIE:PowerPoint Remote Operations

From WiiLi

Jump to: navigation, search
// PowerPointLite Remote Operations v1.1
// by: the_white_knight3


//Included in this script, are modified versions of WiiMouse 0.1
//created by WiiScript.co.uk and Wiimote Battery Display by J.Coulston

//Thanks to anamatv for debugging the "Slideshow Start"

//Instructions:
//Up = keyboard Up
//Down = keyboard Down
//Left = keyboard Left
//Right = keyboard Right
//B = Enter / Left Mouse Click in Mouse Mode
//A = keyboard Left / Right Mouse Click in Mouse Mode
//Hold-Plus = Begin Slideshow
//Home = Battery Check / Pressed twice exits SlideShow
//Minus = First Slide
//1 = Activate or Deactivate Mouse Mode
//2 = Black the screen
//Hold A+B = GotoSlide Window / First Slide while in Mouse Mode

//Movement of the Wiimote will control the mouse cursor in Mouse Mode


if( wiimote.Leds != 0 ) then
   wiimote.Leds = 0;
endif

//When A and B are pressed, PowerPoint should open the Goto Slide window
if (Wiimote.A && Wiimote.B) then
   wait 1 second;
      if(Wiimote.A && Wiimote.B)then
      var.CtrlS = true;
      endif
    wait 1 second;
    var.CtrlS =  false;
endif

Ctrl+S = var.CtrlS;


//If the plus button is pressed, Activate SlideShow Mode
if (Wiimote.Plus) then
   wait 1 seconds;
   if( Wiimote.Plus ) then
      Shift+F5 = true;
      Shift+F5 = false;
   endif
endif

//If the minus button is pressed, then go back to slide 1.
if (Wiimote.Minus) then
   var.OneEnter = true;
else
   var.OneEnter = false;
endif

One+Enter = var.OneEnter;


//If the home button is pressed, if doubleclicked, end the slideshow, else
//show battery level
if (Wiimote.home) then
   if( doubleclicked(Wiimote.home) ) then
      press(key.Ctrl);
      press(key.Break);
      release(key.Ctrl);
      release(key.Break);
   else
      wait 200 ms;
      var.DisplayBattery = true;
      wait 5 seconds;
      var.DisplayBattery = false;
   endif
endif

//Set default controls
Up = wiimote.Up;
Down = wiimote.Down;
Right = wiimote.Right;
Left = (wiimote.Left || var.moveleft);
Mouse.LeftButton = var.leftclick;
Mouse.RightButton = var.rightclick;
key.Enter =  var.enter;
Key.B = Wiimote.Two;


//Set control variables
var.rightclick =  false;
var.leftclick =  false;
var.moveleft =  Wiimote.A ;
var.enter = Wiimote.B;

//Activate Mouse Mode
if pressed(wiimote.One) && (var.changeMouse != 1) then
   var.activeMouse = 1;
endif

//Deactivate Mouse Mode
if pressed(wiimote.One)&& (var.changeMouse == 1) then
   var.activeMouse = -1;
endif

var.changeMouse = (1 * var.activeMouse);

//Retrieve the Wiimote's Position Data
var.x = Wiimote.gx;
var.y = Wiimote.gy;
var.z = Wiimote.gz;

//If the Mouse Mode is Active, Setup Mouse Controls
if (var.activeMouse == 1) then

   var.rightclick = Wiimote.A;
   var.leftclick = Wiimote.B
   var.enter =  false;
   var.moveleft = false;

   //WiiMouse Version 0.1
   //www.wiiscript.co.uk
   //Based upon Unplayable BF2 Control Script by Duke4ever

   //WiiMouse 0.1
   //Created by WiiScript.co.uk

   //precision
   var.sense0 = 500;
   var.thresh0x = 5/30;
   var.thresh0y = 2/30;

   var.sense = 300;
   var.threshx = 10/30;
   var.threshy = 5;

   var.sense2 = 100;
   var.thresh2x = 15/30;
   var.thresh2y = 8/30;

   var.sense3 = 50;
   var.thresh3x = 20/30;
   var.thresh3y = 12/30;

   //first sensitivity setting
   //xaxis
   if (var.x > var.thresh0x) then
      mouse.x = mouse.x - 1/var.sense0;
   endif

   if (var.x < -var.thresh0x) then
      mouse.x = mouse.x + 1/var.sense0;
   endif

   //yaxis
   if (var.z > var.thresh0y) then
      mouse.y = mouse.y - 1/var.sense0;
   endif

   if (var.z < -var.thresh0y) then
      mouse.y = mouse.y + 1/var.sense0;
   endif


   //second sensitivity setting
   //xaxis
   if (var.x > var.threshx)
      mouse.x = mouse.x - 1/var.sense;
   endif

   if (var.x < -var.threshx)
      mouse.x = mouse.x + 1/var.sense;
   endif

   //yaxis
   if (var.z > var.threshy)
      mouse.y = mouse.y - 1/var.sense;
   endif

   if (var.z < -var.threshy)
      mouse.y = mouse.y + 1/var.sense;
   endif

   //third sensitivity setting
   //xaxis
   if (var.x > var.thresh2x )
      mouse.x = mouse.x - 1/var.sense2;
   endif

   if (var.x < -var.thresh2x)
       mouse.x = mouse.x + 1/var.sense2;
   endif

   //yaxis
   if (var.z > var.thresh2y)
      mouse.y = mouse.y - 1/var.sense2;
   endif

   if (var.z < -var.thresh2y)
      mouse.y = mouse.y + 1/var.sense2;
   endif

   //fourth sensitivity setting
   //xaxis
   if (var.x > var.thresh3x)
      mouse.x = mouse.x - 1/var.sense3;
   endif

   if (var.x < -var.thresh3x)
      mouse.x = mouse.x + 1/var.sense3;
   endif

   //yaxis
   if (var.z > var.thresh3y)
      mouse.y = mouse.y - 1/var.sense3;
   endif

   if (var.z < -var.thresh3y)
      mouse.y = mouse.y + 1/var.sense3;
   endif

endif




//If Battery Display is requested, Activate Battery Displays
if(var.DisplayBattery)  then


   //Wiimote Battery Display
   //by J.Coulston
   // Modified by Carl Kenner for GlovePIE 0.25

   //A full battery gives 0xC0 (192)
   var.Batt = wiimote.Battery / 48;



   if (true) then
      wait 5 seconds;
      //it sends an instruction that tells the Wiimote to actually
      //send the report.
      Wiimote.Report15 = 0x80 | Int(wiimote.Rumble);
   endif

   //Display the battery level of your wiimote using the four LEDs on the bottom.
   //Battery level is displayed in four levels increasing to the right, like a cell
   //phone battery gauge. As the battery gets close to the next level down, the LED
   //for the current level will blink.

   //Blink rate
   var.Blink = 500ms;

   if (0<=var.Batt<=0.25) then
      Wiimote.Leds = 1;
      wait var.Blink;
      Wiimote.Leds = 0;
      wait var.Blink;
   elseif (0.25 < var.Batt<=1) then
      Wiimote.Leds = 1;
   elseif (1 < var.Batt<=1.25) then
      Wiimote.Leds = 3;
      wait var.Blink;
      Wiimote.Leds = 1;
      wait var.Blink;
   elseif (1.25 < var.Batt<=2) then
      Wiimote.Leds = 3;
   elseif (2 < var.Batt<=2.25) then
      Wiimote.Leds = 7 ;
      wait var.Blink;
      Wiimote.Leds = 3;
      wait var.Blink;
   elseif (2.25 < var.Batt<=3) then
      Wiimote.Leds = 7;
   elseif (3 < var.Batt<=3.25) then
      Wiimote.Leds = 15;
      wait var.Blink;
      Wiimote.Leds = 7;
      wait var.Blink;
   elseif (3.25 < var.Batt<=4) then
      Wiimote.Leds = 15;
   else
      Wiimote.Leds = 0;
   endif
endif


debug = var.x + " " + var.y + " " + var.z + " " + var.activeMouse
Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy