Map remote button to eject
#1
I apologise in advance for asking this, because I'm sure it's answered already, but I am really struggling to find it.

Briefly - XBMC working really well on a PC running Ubuntu 9.04. I'm using the mediastream skin because I quite like it, and the other people in the house find it the most usable by a long way.

But I can't eject a CD/DVD. I have to log in physically or by ssh and run "eject". The button on the front of the PC does nothing while XBMC is running.

The remote I'm using doesn't have an "eject",but it does have several spare keys (including "on/off", which I want to disable!) which come through when I run irw.

So, my question is - is there a way to get a known key X on the remote to trigger an "eject" command?

(Ideally, the "power" key - the MCE remote works fine, but the other half complains when she hits the power key and shuts it down accidentally...)
Reply
#2
nock yourself out Tongue

http://wiki.xbmc.org/?title=Keymap.xml
Reply
#3
blittan Wrote:nock yourself out Tongue

http://wiki.xbmc.org/?title=Keymap.xml


Er, that's exactly why I posted the question. That document tells us how to map keys. I can use that to swap buttons around fine, but where's eject?
Reply
#4
Try "EjectTray"
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
jmarshall Wrote:Try "EjectTray"

Marvellous, just what I was looking for! Thanks.

I ended up with <power>XBMC.EjectTray()</power> Works like a charm, and I now have a happy girlfriend (getting discs out was the one thing stopping her letting me bin the old DVD player...)
Reply
#6
Grobbendonk Wrote:letting me bin the old DVD player...
Please either donate the old player to a thrift store/chain (e.g. Goodwill) or properly dispose/recycle it - electronics contain toxic chemicals that can leach into groundwater from dumps. (Bet you didn't know there's arsenic in there...)
Reply
#7
Grobbendonk Wrote:Marvellous, just what I was looking for! Thanks.

I ended up with <power>XBMC.EjectTray()</power> Works like a charm, and I now have a happy girlfriend (getting discs out was the one thing stopping her letting me bin the old DVD player...)

Oke, so here i am trying to do the same thing with my Asrock 330HT remote in wich i do not succeed because my Linux knowledge is really crap. So here i go.

I found the keymap XML and tried to put the eject thingy on to the last button of my remote now i was searching in that keyboard.xml file and did not found the <power> thingy so my question is where can i find that <power> thingy so i may set it to the power button aswel.

Thanks allot.

Greetz,
Fjerpje
Asrock ION 330HT, XBMCFreak Nuvoton 10.00 Experimental version 2
Reply
#8
To point out the thing i want to do axactly is that, i have a Asrock 330HT wich comes with a remote with a big green Windows button on the center of the remote.

I dont know if there are any people familiar with this remote but there's a small black button with a red dot in the center of it, located at the top left on the remote. When you are in XBMC, this button is dedicated to open a screenshot side panel.

Now i don't want to make screenshots in XBMC in the near future so i think this button can be readressed to another function. Wich is the eject function for my CD/DVD drive The point is that i do not have much knowledge of Linux so i'm afraid that i will screw things up after i made some adjustments. So my question is if there is someone with an Asrock 330HT that achieved the same thing as i want to do and want to give me a little hand with it in some explanation. Or if someone knows howto than would you help me out?

I would really appreciate the help. I've gotten way far with all of the help i got here and i am really thankfull for it. If someone could help me with this would be again great! Thanks already.

Greetz,
Fjerpje
Asrock ION 330HT, XBMCFreak Nuvoton 10.00 Experimental version 2
Reply
#9
Fjerpje Wrote:To point out the thing i want to do axactly is that, i have a Asrock 330HT wich comes with a remote with a big green Windows button on the center of the remote.

I dont know if there are any people familiar with this remote but there's a small black button with a red dot in the center of it, located at the top left on the remote. When you are in XBMC, this button is dedicated to open a screenshot side panel.

Now i don't want to make screenshots in XBMC in the near future so i think this button can be readressed to another function. Wich is the eject function for my CD/DVD drive The point is that i do not have much knowledge of Linux so i'm afraid that i will screw things up after i made some adjustments. So my question is if there is someone with an Asrock 330HT that achieved the same thing as i want to do and want to give me a little hand with it in some explanation. Or if someone knows howto than would you help me out?

I would really appreciate the help. I've gotten way far with all of the help i got here and i am really thankfull for it. If someone could help me with this would be again great! Thanks already.

Greetz,
Fjerpje

AFter some research i've gotten this to work! And it works like a charm it is actualy located in the remote.xml file wich contains the mappings for the Asrock 330HT remote.
Asrock ION 330HT, XBMCFreak Nuvoton 10.00 Experimental version 2
Reply
#10
jmarshall Wrote:Try "EjectTray"

How did you find that? Where are the masses supposed to look? That is not in the wiki or in the file ButtonTranslator.cpp which the wiki refers to.

[EDIT]
Okay, I found this: http://wiki.xbmc.org/?title=List_of_Built_In_Functions and the stuff in Builtins.cpp. Obviously a developer would know this already, but it's not as clear for the users.
Reply
#11
crackers Wrote:Please either donate the old player to a thrift store/chain (e.g. Goodwill) or properly dispose/recycle it - electronics contain toxic chemicals that can leach into groundwater from dumps. (Bet you didn't know there's arsenic in there...)

Absolutely. "Recycle" in my world means "find it a good home if you know anyone who would make good use of it, try the charity shops, and worst case, drop it off at the recycling centre".
Reply
#12
Sorry to bump an old thread, but this is the first thread that comes up in google results for this solution and I thought it would be best to post here so that others that come across the thread see this post.

I am a bit of a newbie to xbmc so thought I would post idiot-proof (hopefully!) instructions how to map a button on your IR remote to eject the disk tray. Took me a couple hours to figure out how to do this as the instructions in this thread are slightly outdated now with the newer XBMC versions, so hopefully this can make it easier for other newbies.

I wanted my remote to be able to eject my dvd tray so that I can stealth my dvd tray with my htpc case to make it look cleaner while also allowing my parents to be able to easily eject and close the tray without having to mess about finding the eject position on the stealthed disk tray.

These worked for me in OpenElec with a HP MCE IR Receiver and a Harmony One acting as a MCE Remote:

1) SSH into your HTPC

2) Type the command "irw"

3) Press the button on your remote that you want to eject the disk tray.
I chose to map the star (*) key on my MCE remote to eject the disk tray
It will show the device name for the remote (mine was devinput) and the key name (mine was KEY_NUMERIC_STAR)

4) Visit this site to find out what the name is for the key you want to use:
https://github.com/xbmc/xbmc/blob/master...remote.xml
(It is <star> for the * button)

From here on I am assuming you are also using the * button, if not just replace the relevant parts

5) Create “Lircmap.xml” file in “Userdata” folder and enter:

Code:
<lircmap>
<remote device="devinput">
<star>KEY_NUMERIC_STAR</star>
</remote>
</lircmap>

6) Create “keyboard.xml” file in “Keymaps” folder (Inside “Userdata” folder) and enter:

Code:
<keymap>
<home>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</home>
</keymap>

7) Restart your htpc

8) Now the star (*) key will eject your disk tray when on the xbmc home screen

N.B. If you want the star key to eject the disk tray in all menus of xbmc and not just the home screen, you want your keyboard.xml file to look like:

Code:
<keymap>

<global>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</global>

<home>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</home>

<fullscreenvideo>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</fullscreenvideo>

<myfiles>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</myfiles>

<mymusicfiles>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</mymusicfiles>

<mymusiclibrary>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</mymusiclibrary>

<myvideofiles>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</myvideofiles>

<virtualkeyboard>
<remote>
<star>XBMC.EjectTray()</star>
</remote>
</virtualkeyboard>

</keymap>


Setting it in the <global> tags sets it for all areas where the key is not normally used. So I had to set it for all other menus where the star key is normally used (in music it ques the next song, and in full screen video playing it cycles through subtitles, etc). Found these other areas out by checking the remote.xml file in the github link above where the <star> tag is used in that xml file.

Hope this helps anybody else looking for a solution to ejecting with a IR remote Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Map remote button to eject0