2009-07-30, 11:42
Hi I'm writing simple c# program to send key event to XBMC , I use WiimoteLib from http://www.codeplex.com/WiimoteLib.
some code is here.
I use SendWait method to simulate key press to any other application. On my machine it work well, I can use wiimote to control XBMC such as press right button on Wiimote = press right arrow on keyboard.
The problem
When i move this app to another machine XBMC not response for Wiimote in right action. such as I press Wiimote right,left,A button the XBMC response for all button like ESC key (i only map this key with Wiimote B button). I don't understand why XBMC response like that. I think i don't touch any configuration file include keymap.xml or whatever.
My machine is Windows 7,
Other machine include Windows XP SP3 and Windows 7 (have same problem)
I used same version of XBMC for all machine.
Can anyone can explain me what wrong?
Sorry with statement, I'm not english native speaker.
Think you.
some code is here.
Code:
// key pressed event
private void HandleWiiPress(WiimoteState ws){
// handle signal
if (ws.ButtonState.A){
SendKeys.SendWait("{ENTER}");
}
else if (ws.ButtonState.B){
SendKeys.SendWait("{ESC}");
}
else if (ws.ButtonState.Home){
SendKeys.SendWait("{ESC}");
}
else if (ws.ButtonState.Right) {
SendKeys.SendWait("{RIGHT}");
}
else if (ws.ButtonState.Left){
SendKeys.SendWait("{LEFT}");
}
else if (ws.ButtonState.Up)
{
SendKeys.SendWait("{UP}");
}
else if (ws.ButtonState.Down) {
SendKeys.SendWait("{DOWN}");
}
else if (ws.ButtonState.Plus)
{
SendKeys.SendWait("=");
}
else if (ws.ButtonState.Minus)
{
SendKeys.SendWait("-");
}
}
I use SendWait method to simulate key press to any other application. On my machine it work well, I can use wiimote to control XBMC such as press right button on Wiimote = press right arrow on keyboard.
The problem
When i move this app to another machine XBMC not response for Wiimote in right action. such as I press Wiimote right,left,A button the XBMC response for all button like ESC key (i only map this key with Wiimote B button). I don't understand why XBMC response like that. I think i don't touch any configuration file include keymap.xml or whatever.
My machine is Windows 7,
Other machine include Windows XP SP3 and Windows 7 (have same problem)
I used same version of XBMC for all machine.
Can anyone can explain me what wrong?
Sorry with statement, I'm not english native speaker.
Think you.