home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My Emulators
(Old) My Emulators
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="pacosal" data-source="post: 128568" data-attributes="member: 19003"><p>Hi, this is the first time, I've seen this plugin, and think that's great. Last weekend I've been working in a tiny program to launch emulator roms, but I dont have time to follow working on it.</p><p></p><p>I have a Wii console and as you know there is a program (glovepie) that permits load a script and send keys to another program (thas is focused). Therefore, I've done a script that permits me to use mediaportal from my wiimote, when I close mediaportal my program focus again, and I can choose other program like an emulator and do the same thing. </p><p></p><p>How do I do it?</p><p></p><p>I capture a hotkey (Ctrl+z) in my program. Launch a program, with a glovepie script. When in this program o game I press "Home key" (wiimote key), the script press Ctrl+z and my program is back, then close the glovepie script, the emulator and load my own glovepie script. </p><p></p><p>It's hard for me to explain this in english!</p><p></p><p>Please test wiimote and nunchuck on your pc and emulator, it's very cool...</p><p></p><p>Ok, I want to help you, with a small code. </p><p></p><p></p><p>FORM1.CS</p><p>-------------</p><p></p><p>using System;</p><p>using System.Collections.Generic;</p><p>using System.ComponentModel;</p><p>using System.Data;</p><p>using System.Drawing;</p><p>using System.Text;</p><p>using System.Windows.Forms;</p><p>using System.Xml;</p><p>using System.Runtime.InteropServices;</p><p>using System.Drawing.Imaging;</p><p>using System.Collections;</p><p>using System.Runtime.InteropServices.ComTypes;</p><p>using System.Globalization;</p><p>using System.Reflection;</p><p>using System.Diagnostics;</p><p></p><p>namespace wii_n64</p><p>{</p><p> public partial class Form1 : Form</p><p> {</p><p></p><p> [DllImport("user32.dll", CharSet = CharSet.Auto)]</p><p> public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);</p><p></p><p> // HOT key dlls</p><p> [DllImport("user32.dll")]</p><p> public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc);</p><p> [DllImport("user32.dll")]</p><p> public static extern bool UnregisterHotKey(IntPtr hWnd, int id);</p><p></p><p> System.Diagnostics.Process p;</p><p> System.Diagnostics.Process pJuego;</p><p> System.Diagnostics.Process pPropio;</p><p></p><p> public Form1()</p><p> {</p><p> InitializeComponent();</p><p></p><p> // Alt =1 , Ctrl =2, Shift =4, Win =0</p><p> //register hot Ctrl , Alt, and 'z'</p><p> bool success = Form1.RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 2 ,(int)'Z');</p><p> if (success)</p><p> {</p><p> Console.WriteLine("Alt-z hot key successfully registered");</p><p> }</p><p> else</p><p> MessageBox.Show("Could not register Hotkey - there is probably a conflict. ", "", MessageBoxButtons.OK, MessageBoxIcon.Error);</p><p></p><p> }</p><p></p><p> private void activo()</p><p> {</p><p> String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe ";</p><p> String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\wii_n64.pie";</p><p></p><p> // activar el foco</p><p> this.Focus();</p><p></p><p> System.Threading.Thread.Sleep(2000);</p><p></p><p> pPropio = System.Diagnostics.Process.Start(glovepie, p1);</p><p> timer1.Enabled = true;</p><p></p><p> }</p><p></p><p> protected override void WndProc(ref System.Windows.Forms.Message m)</p><p> {</p><p> // defined in winuser.h</p><p> const int WM_DRAWCLIPBOARD = 0x308;</p><p> const int WM_CHANGECBCHAIN = 0x030D;</p><p></p><p> switch (m.Msg)</p><p> {</p><p> case 0x0312:</p><p> activo();</p><p> break;</p><p></p><p> default:</p><p> base.WndProc(ref m);</p><p> break;</p><p> }</p><p> }</p><p></p><p></p><p></p><p> private void Form1_Load(object sender, EventArgs e)</p><p> {</p><p></p><p> this.activo();</p><p> </p><p> }</p><p></p><p> private void button1_Click(object sender, EventArgs e)</p><p> {</p><p> String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe ";</p><p> String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\MARIO_CAR_64.pie";</p><p> String emulador = "C:\\apl\\Project64 1.6\\Project64.exe ";</p><p> String pJ = "C:\\wii\\wii\\roms\\Mario_Kart_64\\Mario Kart 64 (E) (V1.0) [!].z64";</p><p></p><p> // matar glovepie principal</p><p> pPropio.CloseMainWindow();</p><p> System.Threading.Thread.Sleep(2000);</p><p> p = System.Diagnostics.Process.Start(glovepie,p1);</p><p></p><p> System.Threading.Thread.Sleep(5000);</p><p> pJuego = System.Diagnostics.Process.Start(emulador, pJ);</p><p></p><p></p><p> }</p><p></p><p> private void button2_Click(object sender, EventArgs e)</p><p> {</p><p> String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe ";</p><p> String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\MediaPortal.pie";</p><p></p><p> // matar glovepie principal</p><p> pPropio.CloseMainWindow();</p><p> System.Threading.Thread.Sleep(2000);</p><p></p><p> p = System.Diagnostics.Process.Start(glovepie, p1);</p><p></p><p> }</p><p></p><p> private void Form1_Activated(object sender, EventArgs e)</p><p> {</p><p> if (p!= null && !p.HasExited)</p><p> p.CloseMainWindow();</p><p></p><p> if (pJuego != null && !pJuego.HasExited)</p><p> pJuego.CloseMainWindow();</p><p> </p><p> }</p><p></p><p> private void timer1_Tick(object sender, EventArgs e)</p><p> {</p><p> this.Focus();</p><p> timer1.Enabled = false;</p><p> }</p><p> }</p><p>}</p><p></p><p></p><p>wii_n64.PIE</p><p>--------------</p><p></p><p></p><p>Key.Enter = Wiimote.A</p><p>Key.Escape = Wiimote.B</p><p>Key.Up = Wiimote.Up</p><p>Key.Down = Wiimote.Down</p><p>Key.Right = Wiimote.Right</p><p>Key.Left = Wiimote.Left</p><p>key.VolumeUp = Wiimote.Plus</p><p>key.VolumeDown = Wiimote.Minus</p><p></p><p>MinimizePie</p><p></p><p>WiiMote.leds = 1</p><p></p><p></p><p>MEDIAPORTAL.PIE</p><p>------------------------</p><p></p><p></p><p>Key.Enter = Wiimote.A</p><p>Key.Escape = Wiimote.B</p><p>Key.Up = Wiimote.Up</p><p>Key.Down = Wiimote.Down</p><p>Key.Right = Wiimote.Right</p><p>Key.Left = Wiimote.Left</p><p>key.VolumeUp = Wiimote.Plus</p><p>key.VolumeDown = Wiimote.Minus</p><p></p><p>var.zCutoff1 = 6/30</p><p>var.zCutoff2 = 10/30</p><p>var.zCutoff3 = 15/30</p><p></p><p>var.xRot =Wiimote.gx</p><p>var.yRot =Wiimote.gy </p><p>var.zRot =Wiimote.gz </p><p></p><p>if Wiimote.Home</p><p> Ctrl+key.Z = true;</p><p> wait 500ms</p><p>endif</p><p></p><p>//debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot</p><p></p><p>if var.zRot > var.zCutoff3 then</p><p> key.Up = true</p><p> wait 50ms</p><p> key.Up = false</p><p>else if var.zRot < -var.zCutoff3 then</p><p> key.Down = true</p><p> wait 50ms</p><p> key.Down = false</p><p>else if var.zRot > var.zCutoff2 then</p><p> key.Up = true</p><p> wait 300ms</p><p> key.Up = false</p><p>else if var.zRot < -var.zCutoff2 then</p><p> key.Down = true</p><p> wait 300ms</p><p> key.Down = false</p><p>else if var.zRot > var.zCutoff1 then</p><p> key.Up = true</p><p> wait 400ms</p><p> key.Up = false</p><p>else if var.zRot < -var.zCutoff1 then</p><p> key.Down = true</p><p> wait 400ms</p><p> key.Down = false</p><p>endif</p><p></p><p></p><p>Wiimote.leds = 2 </p><p></p><p>MARIO_CAR_64.PIE</p><p>------------------------</p><p></p><p>//Mario Kart N64 controls </p><p>//By petergriffin and TweaK</p><p></p><p>var.zCutoff1 = 6/30 </p><p>var.zCutoff2 = 12/30 </p><p>var.zCutoff3 = 23/30 </p><p>// Hold the controller sideways like you do in Exite Truck 1 is A, 2 is B </p><p>// And Right (or Up if held sideways) is use item. Steering is as simple as </p><p>// Turning the Wiimote right or left. A+B is Start. Plus is up and minus is //down </p><p>// A is R and B is L </p><p>// Set the Emulator so that A=A B=B Z=Z Start=S R=R L=L And the Directions set to the arrow keys </p><p>var.xRot =Wiimote.gx </p><p>var.yRot =Wiimote.gy </p><p>var.zRot =Wiimote.gz </p><p></p><p>if Wiimote.Home</p><p> Ctrl+key.Z = true;</p><p> wait 500ms</p><p>endif</p><p></p><p></p><p>debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot </p><p></p><p>if var.zRot > var.zCutoff3 then </p><p> key.right = true </p><p> key.left = true </p><p> key.left = false </p><p> wait 20ms </p><p> key.right = false </p><p>else if var.zRot < -var.zCutoff3 then </p><p> key.left = true </p><p> key.right = true </p><p> key.right = false </p><p> wait 20ms </p><p> key.left = false </p><p>else if var.zRot > var.zCutoff2 then </p><p> key.right = true </p><p> key.left = true </p><p> key.left = false </p><p> wait 12ms </p><p> key.right = false </p><p>else if var.zRot < -var.zCutoff2 then </p><p> key.left = true </p><p> key.right = true </p><p> key.right = false </p><p> wait 12ms </p><p> key.left = false </p><p>else if var.zRot > var.zCutoff1 then </p><p> key.right = true </p><p> key.left = true </p><p> key.left = false </p><p> wait 2ms </p><p> key.right = false </p><p>else if var.zRot < -var.zCutoff1 then </p><p> key.left = true </p><p> key.right = true </p><p> key.right = false </p><p> wait 2ms </p><p> key.left = false </p><p>else </p><p> key.left = True </p><p> key.right = True </p><p> key.left = false </p><p> key.right = false </p><p>endif </p><p></p><p></p><p>key.x = Wiimote.One </p><p>key.c = Wiimote.Two </p><p>key.z = Wiimote.Right </p><p>key.Enter = Wiimote.A+Wiimote.B </p><p>key.up = Wiimote.Plus </p><p>key.down = Wiimote.Minus </p><p>key.s = Wiimote.A </p><p>key.a = Wiimote.B </p><p>Wiimote.leds = 4 </p><p></p><p></p><p>I hope, you can continue your work and make this for us. </p><p></p><p>Dont buy a Wii, buy a Wiimote + Nunchuk is cheaper!</p><p></p><p>Pacosal</p></blockquote><p></p>
[QUOTE="pacosal, post: 128568, member: 19003"] Hi, this is the first time, I've seen this plugin, and think that's great. Last weekend I've been working in a tiny program to launch emulator roms, but I dont have time to follow working on it. I have a Wii console and as you know there is a program (glovepie) that permits load a script and send keys to another program (thas is focused). Therefore, I've done a script that permits me to use mediaportal from my wiimote, when I close mediaportal my program focus again, and I can choose other program like an emulator and do the same thing. How do I do it? I capture a hotkey (Ctrl+z) in my program. Launch a program, with a glovepie script. When in this program o game I press "Home key" (wiimote key), the script press Ctrl+z and my program is back, then close the glovepie script, the emulator and load my own glovepie script. It's hard for me to explain this in english! Please test wiimote and nunchuck on your pc and emulator, it's very cool... Ok, I want to help you, with a small code. FORM1.CS ------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Xml; using System.Runtime.InteropServices; using System.Drawing.Imaging; using System.Collections; using System.Runtime.InteropServices.ComTypes; using System.Globalization; using System.Reflection; using System.Diagnostics; namespace wii_n64 { public partial class Form1 : Form { [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam); // HOT key dlls [DllImport("user32.dll")] public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc); [DllImport("user32.dll")] public static extern bool UnregisterHotKey(IntPtr hWnd, int id); System.Diagnostics.Process p; System.Diagnostics.Process pJuego; System.Diagnostics.Process pPropio; public Form1() { InitializeComponent(); // Alt =1 , Ctrl =2, Shift =4, Win =0 //register hot Ctrl , Alt, and 'z' bool success = Form1.RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 2 ,(int)'Z'); if (success) { Console.WriteLine("Alt-z hot key successfully registered"); } else MessageBox.Show("Could not register Hotkey - there is probably a conflict. ", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } private void activo() { String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe "; String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\wii_n64.pie"; // activar el foco this.Focus(); System.Threading.Thread.Sleep(2000); pPropio = System.Diagnostics.Process.Start(glovepie, p1); timer1.Enabled = true; } protected override void WndProc(ref System.Windows.Forms.Message m) { // defined in winuser.h const int WM_DRAWCLIPBOARD = 0x308; const int WM_CHANGECBCHAIN = 0x030D; switch (m.Msg) { case 0x0312: activo(); break; default: base.WndProc(ref m); break; } } private void Form1_Load(object sender, EventArgs e) { this.activo(); } private void button1_Click(object sender, EventArgs e) { String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe "; String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\MARIO_CAR_64.pie"; String emulador = "C:\\apl\\Project64 1.6\\Project64.exe "; String pJ = "C:\\wii\\wii\\roms\\Mario_Kart_64\\Mario Kart 64 (E) (V1.0) [!].z64"; // matar glovepie principal pPropio.CloseMainWindow(); System.Threading.Thread.Sleep(2000); p = System.Diagnostics.Process.Start(glovepie,p1); System.Threading.Thread.Sleep(5000); pJuego = System.Diagnostics.Process.Start(emulador, pJ); } private void button2_Click(object sender, EventArgs e) { String glovepie = "c:\\wii\\wii\\glovePIE029\\Glovepie.exe "; String p1 = "-C:\\wii\\wii\\GlovePIE029\\NUEVOS\\MediaPortal.pie"; // matar glovepie principal pPropio.CloseMainWindow(); System.Threading.Thread.Sleep(2000); p = System.Diagnostics.Process.Start(glovepie, p1); } private void Form1_Activated(object sender, EventArgs e) { if (p!= null && !p.HasExited) p.CloseMainWindow(); if (pJuego != null && !pJuego.HasExited) pJuego.CloseMainWindow(); } private void timer1_Tick(object sender, EventArgs e) { this.Focus(); timer1.Enabled = false; } } } wii_n64.PIE -------------- Key.Enter = Wiimote.A Key.Escape = Wiimote.B Key.Up = Wiimote.Up Key.Down = Wiimote.Down Key.Right = Wiimote.Right Key.Left = Wiimote.Left key.VolumeUp = Wiimote.Plus key.VolumeDown = Wiimote.Minus MinimizePie WiiMote.leds = 1 MEDIAPORTAL.PIE ------------------------ Key.Enter = Wiimote.A Key.Escape = Wiimote.B Key.Up = Wiimote.Up Key.Down = Wiimote.Down Key.Right = Wiimote.Right Key.Left = Wiimote.Left key.VolumeUp = Wiimote.Plus key.VolumeDown = Wiimote.Minus var.zCutoff1 = 6/30 var.zCutoff2 = 10/30 var.zCutoff3 = 15/30 var.xRot =Wiimote.gx var.yRot =Wiimote.gy var.zRot =Wiimote.gz if Wiimote.Home Ctrl+key.Z = true; wait 500ms endif //debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot if var.zRot > var.zCutoff3 then key.Up = true wait 50ms key.Up = false else if var.zRot < -var.zCutoff3 then key.Down = true wait 50ms key.Down = false else if var.zRot > var.zCutoff2 then key.Up = true wait 300ms key.Up = false else if var.zRot < -var.zCutoff2 then key.Down = true wait 300ms key.Down = false else if var.zRot > var.zCutoff1 then key.Up = true wait 400ms key.Up = false else if var.zRot < -var.zCutoff1 then key.Down = true wait 400ms key.Down = false endif Wiimote.leds = 2 MARIO_CAR_64.PIE ------------------------ //Mario Kart N64 controls //By petergriffin and TweaK var.zCutoff1 = 6/30 var.zCutoff2 = 12/30 var.zCutoff3 = 23/30 // Hold the controller sideways like you do in Exite Truck 1 is A, 2 is B // And Right (or Up if held sideways) is use item. Steering is as simple as // Turning the Wiimote right or left. A+B is Start. Plus is up and minus is //down // A is R and B is L // Set the Emulator so that A=A B=B Z=Z Start=S R=R L=L And the Directions set to the arrow keys var.xRot =Wiimote.gx var.yRot =Wiimote.gy var.zRot =Wiimote.gz if Wiimote.Home Ctrl+key.Z = true; wait 500ms endif debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot if var.zRot > var.zCutoff3 then key.right = true key.left = true key.left = false wait 20ms key.right = false else if var.zRot < -var.zCutoff3 then key.left = true key.right = true key.right = false wait 20ms key.left = false else if var.zRot > var.zCutoff2 then key.right = true key.left = true key.left = false wait 12ms key.right = false else if var.zRot < -var.zCutoff2 then key.left = true key.right = true key.right = false wait 12ms key.left = false else if var.zRot > var.zCutoff1 then key.right = true key.left = true key.left = false wait 2ms key.right = false else if var.zRot < -var.zCutoff1 then key.left = true key.right = true key.right = false wait 2ms key.left = false else key.left = True key.right = True key.left = false key.right = false endif key.x = Wiimote.One key.c = Wiimote.Two key.z = Wiimote.Right key.Enter = Wiimote.A+Wiimote.B key.up = Wiimote.Plus key.down = Wiimote.Minus key.s = Wiimote.A key.a = Wiimote.B Wiimote.leds = 4 I hope, you can continue your work and make this for us. Dont buy a Wii, buy a Wiimote + Nunchuk is cheaper! Pacosal [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My Emulators
(Old) My Emulators
Contact us
RSS
Top
Bottom