Reset PC with MCE remote
#1
Im using Eden on winXP.
I bought this remote Amazon MCE remote link and it works great but the sleep button doesnt do anything. I am wondering if there is a way I can map that button to reboot the PC. That way if I have any freezes or anything I can attempt to restart pc right from the remote within xmbc. I looked at a few programs including AutoHotKey but everything is so confusing. I only want to map this one button and dont want to learn scripting and go through so much trouble just to do this one thing.Seen a few programs that I can buy that I guess makes it easy to map but I really dont want to spend money to map one button. Im not using Eventghost because it gives me problems where it resets all my settings and no Addons show up.
Please help thanksSmile
Reply
#2
Take a look at the XBMC Launcher script: http://forum.xbmc.org/showthread.php?tid=136798

I use it in a similar situation to put my PC to sleep once XBMC exits, and run it again when it wakes up.
Reply
#3
Thanks for the help.I got errors running that program in XP. Some script errors and uninstalled it a few days ago.
Reply
#4
You can create a custom keyboard.xml (wiki) file in your userdata (wiki)/keymaps/ folder to map the "Power" button on the top-right of the remote to perform one of the shutdown functions. For example, if you want to reboot your PC with that button:
Code:
<keymap>
  <global>
    <keyboard>
      <alt-numpadfive>Reboot</alt-numpadfive>
    </keyboard>
  </global>
</keymap>

Instead of reboot, you can also have that button mapped to Powerdown, Shutdown, Suspend, display the XBMC Shutdown menu, Quit XBMC, etc. See this post for illustrations of some of these other options: http://forum.xbmc.org/showthread.php?tid...pid1197034

However, keep in mind that if XBMC is truly hung, it's not going to be able to respond to your keypress to invoke these built-in functions.
Reply
#5
Thanks for the help! Still a little confused on something though. How does this code know to use that button on my MCE remote? I dont know the code name/number for that button. Am I to replace "alt-numpadfive" with something?
Code:
<keymap>
  <global>
    <keyboard>
      <alt-numpadfive>Reboot</alt-numpadfive>
    </keyboard>
  </global>
</keymap>
Reply
#6
I have the same remote, so I know the name of that button. Wink

To find the name of a given button, enable debug log (wiki)ging in XBMC, press a button several times, exit XBMC, look in your debug log (wiki) (xbmc.log) to see how XBMC identified that button's key presses and what function/action it is currently mapped to, if any.
Reply
#7
Thanks for the info. I created a keyboard.xml script with that code but it didnt work. On my Win7 machine the sleep button(Looks more like a power button to me but guide that came with remote says its sleep) will indeed put my machine in sleep with or with the custom xml but on my winXP machine that I setup for my dad it wont restart the pc with or without that script or put into sleep. Does nothing. So guessing it has something to do with winXP but I dont see why. Any ideas?
Reply
#8
Maybe XBMC doesn't have focus so Windows, rather than XBMC, is intercepting that key press? Maybe your custom keyboard.xml has an error in its contents or is placed in the wrong location?

Do what I described the second paragraph of post #6 and press the Power/Sleep button multiple times and see how/if XBMC is picking up those key presses by examining the log.
Reply
#9
Ive been testing this on my winXP laptop now and still have problems.Win7 pc goes into sleep and press again to get outta sleep and winXP laptop it goes into sleep and when press again it doesnt go outta sleep. I have to manual get outta sleep. PC with winXP that Im using for this remote doesnt do thing when I press sleep.
Had debug mode and check log but when I press sleep it goes into sleep but doesnt show in the log. I tried a differnt button and that shows up fine. I tried mapping that button in the code and it did what it original did and just went into sleep so must be something wrong with the mapping or xml code.
I create a text file, renamed it to keyboard.xml and put in the code.
PHP Code:
<keymap>
  <global>
    <
keyboard>
      <
alt-numpadfive>Reboot</alt-numpadfive>
    </
keyboard>
  </global>
</
keymap

I then put the file in Application Data\XBMC\userdata\keymaps\
I run xbmc and press the sleep button and it goes into sleep.
Reply
#10
Try changing the <alt-numpadfive> line to:
Code:
<alt-numpadfive>Notification(Button pressed, Power, 5000)</alt-numpadfive>
and adding this line right below it:
Code:
<m mod="ctrl">Notification(Button pressed, Blue, 5000)</m>
  1. Restart XBMC and be sure debugging is enabled.
  2. Press the Blue button on the remote. If it displays the notification that the Blue button was pressed, then this means your custom keyboard.xml is being read. If the notification is not displayed, then either there was a problem with the keyboard.xml or perhaps XBMC doesn't have focus.
  3. Press the Power button. If a notification is displayed stating the Power button was pressed, then it's working correctly. If your PC goes to sleep, then there was a problem with the keyboard.xml or perhaps XBMC doesn't have focus.
  4. Exit XBMC and upload a new copy of your debug log to www.xbmclogs.com and post the URL here
Reply

Logout Mark Read Team Forum Stats Members Help
Reset PC with MCE remote0