User:Fortunzfavor

From WiiLi

Jump to: navigation, search

Contents


[edit] Links

GlovePIE:GlovePIE_Scripts | OpenPIE | OpenPIE forum | WiiHD | Video Game Lagoon | Oblivion scripts 1 | nunchuck mouselook | nunchuck 2 |

[edit] Plans

  • To create a glovepie script for video editing with Cuttermaran and Project X.
  • To create a glovepie script for Video File Browsing in Explorer and Viewing in Media Player Classic (complete)
  • To optimize an FPS script for an incredible Allegiance control scheme.
  • To create a Chorded Keyboard script for the wiimote (in progress, near completion).
  • To start a Wiimote Input Project--encouraging scripts that look at the Wiimote as an input device (instead of a controller) for functions like chorded keyboards, Morse code and other community derived ideas.
  • To explore a Wiimote mod to meet the following need:

A left-hand 2nd controller for button-demanding games like MS Allegiance that has more buttons than the nunchuck, but has them closer together and more accessible than the wiimote and uses an analog stick instead of a d-pad to be used in conjunction with an unmodded wiimote in the right hand.

Currently I want to gut a wiimote, leave the IR camera and d-pad behind, and find a housing that can meet these needs with the remainder of the wiimote and a new analog stick. Suggestions on all levels of this modification are welcome.

[edit] Scripts

If you find them useful or interesting, let me know on my discussion page. Feel free to modify them into new scripts (not on my user page though) if you see something that could be done better.

[edit] Media Player Classic Script

(With Windows Explorer functionality):

// Media Player Classic functions and basic Explorer 
// (the file manager, not the browser) keyboard functions
//
// Browse your media files and watch them without motion or 
// IR control.  Tack on any mouse script with (+) and (-) 
// as mouse buttons for DVD control

// CONTROLS:
// 
// (D-Pad) = up, down, left and right
// (A) = Space bar
// (B) = Ctrl
// (Home) = Return
// (1) = tab
// (2) = alt
// 

// Media Player Classic (default key layout)
//
// Play/Pause = (A)
// Medium Skip forward/back = (B) + (>) / (<)
// Large Skip forward/back = (2) + (>) / (<)
// Volume = (^) / (v)
// Fullscreen toggle = (2) + (Home)
// If you retask Mute to Ctrl + down in MPC options, then toggle 
//	mute = (B) + (v)
//

// Explorer / XP keys
//
// Change app focus [alt+tab] = (2) + (1)
// Open explorer (requires shortcut key to be assigned 
// 	up down right or left) = (B) + (1) + (x)
// Navigate up and down in folder/file frames = (^) and (v)
// Collapse subfolders = (<)
// Expand subfolders = (>)
// Move from folder frame to file frame and back [tab] = (2)
// Execute file = (Home)
// Focus on excuted media file = (2) + (1)

// Code

Key.Up = Wiimote1.Up
Key.Down = Wiimote1.Down
Key.Space = Wiimote1.A
key.enter = Wiimote1.Home
Key.LeftAlt = Wiimote1.Two
key.tab = Wiimote1.One
Key.Left = Wiimote1.Left
Key.Right = Wiimote1.Right
Key.LeftControl = Wiimote1.B

[edit] Media Player Classic + DVD Mode

//Media Player Classic + DVD mode     by Fortunzfavor

//Normal mode uses all defualt MPC keys.
//DVD Mode requires going tinto MPC options
//and setting keys as they are below

var.heldtime = 500ms

if !var.init
   var.dvdmode = false
   var.init = true
endif


if pressed(helddown(wiimote1.a, var.heldtime)) //Press for 1/2 second to change between modes, leds will toggle as well
   toggle var.dvdmode
endif



if var.dvdmode {   //DVD mode
   wiimote1.leds = 8
   key.w = wiimote1.up
   key.s = wiimote1.down
   key.a = wiimote1.left
   key.d = wiimote1.right
   key.enter = Wiimote1.Home
   key.up = wiimote1.Plus
   key.down = wiimote1.minus

            else  //normal mode
            wiimote1.leds = 1
            Key.Up = Wiimote1.Up
            Key.Down = Wiimote1.Down
            Key.Space = Wiimote1.A
            key.enter = Wiimote1.Home
            Key.LeftAlt = Wiimote1.Two
            key.tab = Wiimote1.One
            Key.Left = Wiimote1.Left
            Key.Right = Wiimote1.Right
            Key.LeftControl = Wiimote1.B
            key.up = wiimote1.Plus
            key.down = wiimote1.minus
}

[edit] Kiimote 1.0: Chorded Keyboard GlovePIE Script

(nearly) Full Keyboard Functionality through combo buttons

The alphabet and number combinations are listed correctly in the Command List (typed before I began scripting), but function keys may not be, and not all punctuation/function keys that are in the code are even listed in the comments. Right now I'm working on a more visually appealing chart (with both 'steering' and 'pointing' orientations listed) for the key combinations, then I'll update the list and make a better quick reference chart. Obviously, you can just look at the code to find what is what, but it's not a short script.

What is a chorded keyboard? A small (one-handed) keyboard that uses keys in combination ("chords") to cut down button numbers, often to 8 or fewer. With training (and an obvious learning curve), you can type as fast with one, and have a free hand.

The first device I ever saw I only vaguely remember. It was on a PBS special, and it was 8 keys on two hand bars of a motorcycle. The rider was on the road a LOT, had a miniature computer screen that he could flip down in front of one eye, and full control of the hardware with those eight keys. I don't remember exactly, but I assume he was a writer, and was focused mainly on typing on the road. That has always stuck in my head, and executing it here seemed like a good way to dive into Glovepie.

Why make one? The Kiimote can't be used with one hand (well, I can't use it with one hand), so this isn't strictly a chorded keyboard. However I dredged up a few DIY chorded keyboard projects on the net, and hardware was a common problem, causing some to even abandon their projects. Using Kiimote, someone could do a hardware mod to the Wiimote (for instance, moving Wiimote 1, 2, + and - to the side where they could be pressed by your 4 support fingers, and leaving the d-pad there for your thumb (other hardware mods could be imagined, a smaller housing could be used sans the IR camera and accelerometer, or both could be utilized as additional keys in a modified script)) and Glovepie, and have a quick solution to the hardware problem.

I'm interested in being part of a Wiimote Input Project, that focuses on and encourages ways of making the Wiimote an input device rather than a game/program controller. Although that is a thin line, I imagine scripts that focus on input from languages like Chinese (maybe Zhuyin input specifically), scripts that incorporate morse code, and in finding other people's ideas of how to use the Wiimote as an input device.

Why choose that letter order? I used the letter frequency chart on wikipedia to assign the most commonly used letters to single (and then dual) combinations, leaving lesser used letters to triples and quads. I also made personal judgment calls about which doubles were easier to hit than others. Other choices were made with a coin toss.

Why not use motion controls and dotvis for more keys? Well, I haven't run out of keys yet. I had considered wiimote position as a type of 'shift' key, and came up with 4 positions that weren't too awkward that could have eliminated quading combinations, but I decided to try this first. The manifest uselessness of the project (except as a learning experience) is likely to wear me out eventually, and I'd like to leave a finished product that people can use or modify at their whim. I'd love to see someone incorporate the accelerometer or ir camera in intuitive ways into an input script. Let me know if you do.

How fast could I type using this? With time and training, you could type faster than I can on a normal keyboard. Getting used to holding all keys in a chord and releasing at the same moment would probably be the most frustrating part. Once you accept that, it should be smooth sailing.

Why do you suck at scripting? I do, although this new revision contains code more sophisticated than I could provide, donated by R.Legault. Any mistakes in the scipt belong to me. Any finesse may be attributed to him.

Why did I just read all that? I can't help you there.

I'm interested in being part of a Wiimote Input Project, that focuses on and encourages ways of making the Wiimote an input device rather than a game/program controller. Although that is a thin line, I imagine scripts that focus on input from languages like Chinese (maybe Zhuyin input specifically), scripts that incorporate morse code, and in finding other people's ideas of how to use the Wiimote as an input device.

//Kiimote 1.0  Full Wiimote Keyboard
//Concept by Fortunzfavor.  Coding generously provided by R.Legault

//keys chosen according to letter frequency chart. Most used letters
//were assigned to the simplest button combinations

//get more scripts at wiili.org
/*Command List
Keys = Wiimote buttons

=Letters=
e = left
t = down
a = right
o = up
i = up + right
n = left + down
s = right + down
h = up + left

r = left + one
d = down + one
l = right + one
c = up + one
u = left + two
m = down + two
w = right + two
f = up + two

g = up + right + one
y = left + down + one
p = right + down + one
b = up + left + one
v = up + right + two
k = left + down + two
j = right + down + two
x = up + left + two
q = up + right + minus
z = up + right + plus

=Numbers=
one = left + one + two
two = down + one + two
three = right + one + two
four = up + one + two
five = up + right + one + two
six = left + down + one + two
seven = right + down + one + two
eight = up + left + one + two
nine = one + two + a
Zero = one + two

=Punctuation etc=
Space = a
comma = one
period = two
colon = left + minus
Semicolon =left + plus
Enter = home
Shift = b
CapsLock = up + home
BackSpace = up + plus

*/

//Increased framerate because of the # of comparisons (may need to be higher after all conditions are input? Nested ifs to determine button combination should increase performance)
PIE.FrameRate = 60Hz

      //buttons not used in combination
key.Shift = wiimote.B

//Time to wait before removing erroneous button from combination (after the button has been released)
var.ErrorTime = 500ms
//Time to wait between key press
var.KeyPressTime = 25ms

//If any button is pressed reset timer
if Pressed(Wiimote.A) || Pressed(Wiimote.One) || Pressed(Wiimote.Two) || Pressed(Wiimote.Up) || Pressed(Wiimote.Down) || Pressed(Wiimote.Left) || Pressed(Wiimote.Right) || Pressed(Wiimote.Plus) || Pressed(Wiimote.Minus) || Pressed(Wiimote.Home)
   var.Type = true
   if Pressed(Wiimote.A) then var.A = true
   if Pressed(Wiimote.One) then var.O = true
   if Pressed(Wiimote.Two) then var.T = true
   if Pressed(Wiimote.Up) then var.U = true
   if Pressed(Wiimote.Down) then var.D = true
   if Pressed(Wiimote.Left) then var.L = true
   if Pressed(Wiimote.Right) then var.R = true
   if Pressed(Wiimote.Plus) then var.P = true
   if Pressed(Wiimote.Minus) then var.M = true
   if Pressed(Wiimote.Home) then var.H = true
endif

//If an incorrect key has been pressed and then released it will be removed from combo after errortime
if (!Wiimote.A) && var.A
   wait var.ErrorTime
   var.A = false
endif

if (!Wiimote.One) && var.O
   wait var.ErrorTime
   var.O = false
endif

if (!Wiimote.Two) && var.T
   wait var.ErrorTime
   var.T = false
endif

if (!Wiimote.Up) && var.U
   wait var.ErrorTime
   var.U = false
endif

if (!Wiimote.Down) && var.D
   wait var.ErrorTime
   var.D = false
endif

if (!Wiimote.Left) && var.L
   wait var.ErrorTime
   var.L = false
endif

if (!Wiimote.Right) && var.R
   wait var.ErrorTime
   var.R = false
endif

if (!Wiimote.Plus) && var.P
   wait var.ErrorTime
   var.P = false
endif

if (!Wiimote.Minus) && var.M
   wait var.ErrorTime
   var.M = false
endif

if (!Wiimote.Home) && var.H
   wait var.ErrorTime
   var.H = false
endif

if var.Type
   //All buttons have been released
   if (!Wiimote.A) && (!Wiimote.One) && (!Wiimote.Two) && (!Wiimote.Up) && (!Wiimote.Down) && (!Wiimote.Left) && (!Wiimote.Right) && (!Wiimote.Plus) && (!Wiimote.Minus) && (!Wiimote.Home)
      var.Type = false
      //Output appropriate character for button combination


//four buttons
if (var.u && var.r && var.o && var.t) {
   press(five)
   wait var.KeyPressTime
   release(five)
}

if (var.l && var.d && var.o && var.t) {
   press(six)
   wait var.KeyPressTime
   release(six)
}

if (var.r && var.d && var.o && var.t) {
   press(seven)
   wait var.KeyPressTime
   release(seven)
}

if (var.u && var.l && var.o && var.t) {
   press(eight)
   wait var.KeyPressTime
   release(eight)
}

//Three buttons
if ((var.u && var.r && var.o) && not (var.t)) {
   press(g)
   wait var.KeyPressTime
   release(g)
}

if ((var.l && var.d && var.o) && not (var.t)) {
   press(y)
   wait var.KeyPressTime
   release(y)
}

if ((var.r && var.d && var.o) && not (var.t)) {
   press(p)
   wait var.KeyPressTime
   release(p)
}

if ((var.u && var.l && var.o) && not (var.t)) {
   press(b)
   wait var.KeyPressTime
   release(b)
}

if ((var.u && var.r && var.t) && not (var.o)) {
   press(v)
   wait var.KeyPressTime
   release(v)
}

if ((var.l && var.d && var.t) && not (var.o)) {
   press(k)
   wait var.KeyPressTime
   release(k)
}

if ((var.r && var.d && var.t) && not (var.o)) {
   press(j)
   wait var.KeyPressTime
   release(j)
}

if ((var.u && var.l && var.t) && not (var.o)) {
   press(x)
   wait var.KeyPressTime
   release(x)
}

if ((var.u && var.r && var.m) && not (var.o || var.t)) {
   press(q)
   wait var.KeyPressTime
   release(q)
}

if ((var.u && var.r && var.p) && not (var.o || var.t)){
   press(z)
   wait var.KeyPressTime
   release(z)
}

//two buttons
if ((var.u && var.r) && not (var.o || var.t || var.m || var.p)) {
   press(i)
   wait var.KeyPressTime
   release(i)
}

if ((var.d && var.l) && not (var.o || var.t)) {
   press(n)
   wait var.KeyPressTime
   release(n)
}

if ((var.r && var.d) && not (var.o || var.t)) {
   press(s)
   wait var.KeyPressTime
   release(s)
}

if ((var.u && var.l) && not (var.o || var.t)) {
   press(h)
   wait var.KeyPressTime
   release(h)
}

if ((var.l && var.o) && not (var.u || var.d || var.t)) {
   press(r)
   wait var.KeyPressTime
   release(r)
}

if ((var.d && var.o) && not (var.l || var.r || var.t)) {
   press(d)
   wait var.KeyPressTime
   release(d)
}

if ((var.r && var.o) && not (var.m || var.p || var.u || var.t || var.d || var.l)) {
   press(l)
   wait var.KeyPressTime
   release(l)
}

if ((var.u && var.o) && not (var.r || var.t || var.d || var.l)) {
   press(c)
   wait var.KeyPressTime
   release(c)
}

if ((var.l && var.t) && not (var.o || var.u || var.d)) {
   press(u)
   wait var.KeyPressTime
   release(u)
}

if ((var.d && var.t) && not (var.l || var.r || var.o)) {
   press(m)
   wait var.KeyPressTime
   release(m)
}

if ((var.r && var.t) && not (var.u || var.d || var.o)) {
   press(w)
   wait var.KeyPressTime
   release(w)
}

if ((var.t && var.u) && not (var.o || var.l || var.r)) {
   press(f)
   wait var.KeyPressTime
   release(f)
}

if ((var.o && var.a) && not (var.u || var.d || var.l || var.r || var.t)) {
   press(backspace)
   wait var.KeyPressTime
   release(backspace)
}

if ((var.t && var.a) && not (var.u || var.d || var.l || var.r || var.o)){
   press(Delete)
   wait var.KeyPressTime
   release(delete)
}

if ((var.l && var.m) && not (var.u || var.d || var.o || var.t)) {
   press(semicolon)
   wait var.KeyPressTime                   //Wiimote.B + Semicolon = :
   release(semicolon)
}

if ((var.l && var.p) && not (var.u || var.d || var.o || var.t)) {
   press(slash)
   wait var.KeyPressTime                   //Wiimote.B + Slash = ?
   release(slash)
}

if ((var.d && var.p) && not (var.l || var.r || var.o || var.t)) {
   press(Apostrophe)
   wait var.KeyPressTime                   //Wiimote.B + Apostrophe = "
   release(Apostrophe)
}

if ((var.a && var.m) && not (var.l || var.d || var.u || var.l || var.o || var.t)) {
   press(PageDown)
   wait var.KeyPressTime
   release(pagedown)
}

if ((var.a && var.p) && not (var.l || var.d || var.u || var.l || var.o || var.t)) {
   press(PageUp)
   wait var.KeyPressTime
   release(PageUp)
}

if ((var.a && var.h) && not (var.o || var.t)) {
   press(capslock)
   wait var.KeyPressTime
   release(capslock)
}

if ((var.o && var.h) && not (var.t || var.a || var.u || var.d || var.l || var.r)) {
   press(home)
   wait var.KeyPressTime
   release(home)
}

if ((var.t && var.h) && not (var.o || var.a || var.u || var.d || var.l || var.r)) {
   press(end)
   wait var.KeyPressTime
}


//one button
if ((var.l) && not (var.u || var.r || var.o || var.t || var.d)) {
   press(e)
   wait var.KeyPressTime
   release(e)
}

if ((var.d) && not (var.u || var.r || var.o || var.t || var.l)) {
   press(t)
   wait var.KeyPressTime
   release(t)
}

if ((var.r) && not (var.u || var.o || var.t || var.d || var.l)) {
   press(a)
   wait var.KeyPressTime
   release(a)
}

if ((var.u) && not (var.r || var.o || var.t || var.d || var.l)) {
   press(o)
   wait var.KeyPressTime
   release(o)
}

if ((var.o) && not (var.u || var.r || var.t || var.d || var.l)) {
   press(comma)
   wait var.KeyPressTime
   release(comma)
}

if ((var.t) && not (var.u || var.r || var.o || var.d || var.l)) {
   press(period)
   wait var.KeyPressTime
   release(period)
}

if ((var.h) && not (var.u || var.r || var.o || var.t || var.d || var.l)) {
   press(enter)
   wait var.KeyPressTime
   release(enter)
}

if ((var.a) && not (var.u || var.r || var.o || var.t || var.d || var.l)) {
   press(space)
   wait var.KeyPressTime
   release(space)
}


      //The above really should be implemented with nested ifs to improve performance. Note: you shouldn't try to implement every single possible button combination as there are over 2000

      //Reset all button variables after the appropriate letter has been typed
      var.A = false
      var.O = false
      var.T = false
      var.U = false
      var.D = false
      var.L = false
      var.R = false
      var.P = false
      var.M = false
      var.H = false
   endif
endif
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