Map keys to SHUTDOWN XBMC

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
coquex Offline
Junior Member
Posts: 30
Joined: Sep 2012
Reputation: 0
Post: #1
Hi all,

I´m using Rapier skin on my iMac and a ATV 2 and I want to map a shutdown key since I don't see a button in the Home Rapier screen.

I know I can use the "S" key to toggle the shutdown menu but my intention is to just Quit XMBC with a single hit of a key.

Now for the Apple TV 2 I have the same issue but, I want to map a key or a combination of keys to quit XBMC.

I´m really new to this and I can´t find a way to do it.

Any help please.

Thank you.
find quote
artrafael Offline
Team-XBMC Forum Moderator
Posts: 6,353
Joined: Jul 2010
Reputation: 112
Location: USA
Post: #2
Welcome to the XBMC forums.

You can map a keyboard key to perform an action via a keyboard.xml file. In the <global>/<keyboard> section of the file, assign the desired XBMC action to the desired keyboard key:
Code:
<some-key1>XBMC.Quit</some-key1>       <!-- Quits XBMC application -->
<some-key2>XBMC.Shutdown</some-key2>   <!-- Performs "Shutdown", as defined in XBMC System Settings -->
<some-key3>XBMC.Powerdown</some-key3>  <!-- Powers off your system -->

For the sake of completeness, I'm including the following example even though it may not be an option you desire:
Code:
<some-key4>XBMC.ActivateWindow(shutdownmenu)</some-key4>  <!-- Displays Shutdown menu  -->

See List_of_XBMC_keynames (use key names from column 1 of this list)
See List_of_built-in_functions for these and other functions you may want to assign to keys

Caveat: These should work in theory, but I'm not a Mac user, so I can't verify if they do for that platform.
find quote
coquex Offline
Junior Member
Posts: 30
Joined: Sep 2012
Reputation: 0
Post: #3
Thank you artrafael for your quick answer.

I´m following your instructionns. I will let you know tomorrow.

Thank you.
find quote
coquex Offline
Junior Member
Posts: 30
Joined: Sep 2012
Reputation: 0
Post: #4
It works perfectly, thank you!
find quote
StinDaWg Offline
Fan
Posts: 561
Joined: Jul 2011
Reputation: 1
Post: #5
I still have the problem of XBMC not shutting down properly (stuck in task manager) when hitting the Close button on my remote (VRC-1100) on the latest nightlies. This has been a long standing problem looking at previous posts. I'm trying to map the close button on my remote to the XBMC.Shutdown function but can't get it to work. This is what I have:

Code:
<keymap>
  <global>
    <keyboard>
      <numpadtimes>contextmenu</numpadtimes>
      <numpadfive mod="alt">info</numpadfive>
      <f4 mod="alt">XBMC.Shutdown</f4>
    </keyboard>
  </global>
</keymap>

That doesn't work, it still force closes to task manager. Any ideas?
find quote
Gade Offline
Skilled Skinner
Posts: 236
Joined: Jan 2013
Reputation: 8
Location: Copenhagen, Denmark
Post: #6
The XBMC.ShutDown triggers the default shutdown function defined in the system settings under power saving.

XBMC.Powerdown powers down your system.

XBMC.Quit shuts down XBMC.

Are you trying to shut down you computer or only XBMC?

The Rapier update for Frodo has a POWER Menu, which features all the shutdown functions.
find quote
StinDaWg Offline
Fan
Posts: 561
Joined: Jul 2011
Reputation: 1
Post: #7
I'm trying to Shutdown XBMC. XBMC.Shutdown works fine on another key but not the close button, that's what I'm trying to figure out.
find quote
artrafael Offline
Team-XBMC Forum Moderator
Posts: 6,353
Joined: Jul 2010
Reputation: 112
Location: USA
Post: #8
Did you verify from your debug log that the Close button on your remote actually sends the Alt-F4 keystrokes?
find quote
StinDaWg Offline
Fan
Posts: 561
Joined: Jul 2011
Reputation: 1
Post: #9
I don't see anywhere in the debug log that has that info, but ShowKey says close key is

<f4 mod="alt">Notification(Key, f4, 3)</f4>
(This post was last modified: 2013-09-17 12:58 by StinDaWg.)
find quote
Gade Offline
Skilled Skinner
Posts: 236
Joined: Jan 2013
Reputation: 8
Location: Copenhagen, Denmark
Post: #10
Sending ALT/F4 command to XBMC doesn't shut down the program properly. I just tried the same and it sort of force quits XBMC, but the application still runs in the background of the system. It does not have the time to turn off all the services etc.

It's definately the ALT/F4 command conflicting with the XBMC.ShutDown or XBMC.Quit.
find quote