adding shortcuts to xbmc-remote app's keyboard
#1
Hi,

There were some guides on how change the functions of the buttons by creating and editing the keyboard.xml file in the user folder. However, I don't see a user folder in the xbmc folder, at least not in:

/private/var/mobile/Library/Preferences/XBMC/userdata/

Is this possible? To customize the remote app on the phone and add a button to do a function?

Mainly I'm trying to add a shortcut button that will change the audio setting in XBMC from HDMI cable to Analog via the iphone remote app, rather than needing to turn on the tv and scrolling through the settings.

Possible?

Thanks!
Reply
#2
Welcome to the XBMC forums.

You need to create the custom keyboard.xml file yourself and place it in the keymaps subfolder of your userdata (wiki) folder. However, these override keymappings are used for physical input devices such as keyboards and physical remote controls. They do not apply to virtual remote control apps on mobile devices.
Reply
#3
Thanks for the warm welcome.

Hm...so that file is for input devices...hm....i'm running this on the raspberry pi...it seems like there's a lot of options i can do with this now. Thanks for the clarification on what the keyboard.xml file does. Opens a lot of possibilities now!

If i get anywhere with this, i'll post it on here in case anyone else is interested. The goal is to basically make it so if I want to watch something on the tv, it'll display audio / video through a hdmi port, and if I just want to listen to music on an av sound system, we just turn on the av sound system without the tv, and press a switch to switch the output sound over to the av analog port rather than the hdmi digital.
Reply
#4
I did a makeshift workaround and got this to work with the following instructions below.
It assumes you know how to "SSH" into your raspberry pi, and know some basic linux commands.

Also, I put in my own remote control following these instructions, along with a lircd.conf file.
===== lircd.conf instructions start =================
http://learn.adafruit.com/using-an-ir-re...r/overview
In Brief:
a) Plug IR sensor into pin 1 (3V3), pin 6 (ground), pin 12 (pin 18)
b) To test remote -> in raspberry pi -> programs -> raspberry settings -> IR Remote -> disable “Enable GPIO TSOP IR Receiver”
c) SSH on computer with ie: Putty, into raspberry pi (username pi password raspberry) via IP addy
d) Type in: sudo modprobe lirc_rpi and press enter
e) Type in: sudo kill $(pidof lircd) and press enter
f) Type in: mode2 -d /dev/lirc0 and press enter
g) Now press some buttons on the remote and you should see some pulse and space inputs. If you do, remote is working with IR receiver connected to raspberry pi.
h) In windows, Press alt-break to get out of debug mode
i) Type in: nano lircd.conf and press enter
j) Copy and paste a lirc remote file http://lirc.sourceforge.net/remotes/, paste in Putty by right click mouse button, may need to change names of keys to raspberry pi names: http://xbmc.ru/wiki/index.php?title=Irre...-namespace http://sean-life.com/2013/04/xbmc-and-ra...namespace/ (ie: Power change to KEY_POWER)
k) Ctrl-x to exit, Y to save file, enter to save as filename
l) Type “exit” to logoff ssh.
m) Turn remote on -> in raspberry pi -> programs -> raspberry settings -> IR Remote -> ENABLE “Enable GPIO
n) Select GPIO IR Remote Profile: “Custom (lircd.conf on pi’s home folder)
o) Click OK and restart raspberry when asked.
===== lircd.conf instructions end =================

===== customizing remote keys file start ================
Example used below will be adding function "audiotoggleditigal" to the green button on a samsung remote, which toggles between audio output to HDMI or 3.5 mm jack

Note: any changes made in lircd.conf or *.xml files, you will need to save the changes, than reboot the raspberry pi to have it load and the changes take effect.

If you want to test the remote control to see if the keystrokes are received and logged by the raspberry:
SSH into the raspberry (username: pi, password: raspberry)
on CLI prompt: type "irw"
now press buttons on remote control, and it should register.
to exit, press ctrl-c

Loosely based on:
READ to understand nomenclature and logic behind the files: http://forum.xbmc.org/showthread.php?tid=45972
http://wiki.openelec.tv/index.php?title=...Remap_Keys
and
http://wiki.xbmc.org/index.php?title=Lir...irc_Output
and
http://wiki.xbmc.org/index.php?title=How...g_Commands

For a short list of Samsung Key names for lircd.conf: http://forum.stmlabs.com/showthread.php?...0#pid54590

Steps to add a function onto a remote control to control raspberry pi:
1) if using custom ir remote, upload lircd.conf to /home/pi/ folder
2) add button that you want to use to control function
ie: I used the Green button, so "KEY_GREEN" to corresponding green button hex button
3) in attached folder "copy from raspberry pi - backup" make a copy of remote.xml on your desktop
if you can't find this file, you can download it from the raspberry at:
/opt/xbmc-bcm/xbmc-bin/share/xbmc/system/keymaps/remote.xml
using ssh command with sudo priviledges
cd /opt/xbmc-bcm/xbmc-bin/share/xbmc/system/keymaps/
sudo scp remote.xml [_userid_]@destination_ip:~/ (remember to add :~/ at end of ip)
4) edit the remote.xml file and under "global" if you want to make a global change, scroll to the corresponding key
ie: I used "green".
original: <green>XBMC.ActivateWindow(MyVideos)</green>
changed to: <green>Audiotoggledigital</green>

REF: for a list of pre-set accepted commands: http://wiki.xbmc.org/index.php?title=Keymap.xml#Actions
5) copy altered remote.xml file to the computer's ssh home directory
6) in SSH of raspberry pi, copy new remote.xml file into /home/pi/.xbmc/userdata/keymaps/
cd /home/pi/.xbmc/userdata/keymaps/
sudo scp [_userid_]@sourceip:remote.xml /home/pi/.xbmc/userdata/keymaps/
7) exit SSH
8) On tv, restart XBMC. I found restarting this way rather than "sudo reboot -h" didn't crash the card as much, where I would need to reflash the SD card when rebooting in SSH.


Other References:
Get list of Keyvalues that are pre-defined in XBMC
https://github.com/xbmc/xbmc/blob/master...slator.cpp
scroll down to: function TranslateRemoteString( )

http://wiki.xbmc.org/index.php?title=Lis...C_keynames
===== customizing remote keys file end ================

note there's another way using lircmap.xml, but I couldn't get it to work since the buttons I was using was preprogrammed in the remote.xml file already (green button).

Hope this helps someone out there.
Reply
#5
Regarding above post, the update from Aug 24, 2013 gave a new option under System > Settings > Audio Output > Audio output > select Analog, HDMI, or All to output to both HDMI and Analog. Don't need to do the above anymore.
Reply

Logout Mark Read Team Forum Stats Members Help
adding shortcuts to xbmc-remote app's keyboard0