Kodi Community Forum

Full Version: How do I change keyboard shortcuts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone, I just bought a dinovo mini to replace my rii wireless keyboard and I am loving it, only problem is it doesn't have the function keys and I need them to switch back and forth with terminal and xbmc. I was wondering is it possible to change the keys that do this? If so how?

For example I would like to change Ctrl+Alt+F1 and Ctrl+Alt+F7 or F8 I can't recall which it was, to Crtl+Alt+1 and Ctrl+Alt+2 or something along those lines.
Anyone? I am sure someone with a Dinovo must have thought of this and found a solution...
One final bump in hopes that someone has an answer to this...
I would also like to know if there is an answer to this, I have searched everywhere and I can't seem to find a straight answer so I created an account. Basically all I want is to be able to switch to terminal with a logitech dinovo keyboard, seeing as there are no function keys on the keyboard, how would one be able to do so?
Try this. As root user, you can change your foreground virtual terminal with this command:
Code:
# chvt <ttyN>
where <ttyN> is the terminal number. If you want to be able to execute the command with a non-root user, add the appropriate directive for this non non-root user to the sudoers file (/etc/sudoers).
At this point you are free to create a script and bind it to keyboard shortcuts that you prefer, even from the operating system or from XBMC by editing the keyboard.xml to execute a script.
Since I am very unfamiliar with the process of creating scripts, I just have one question before I dive into this area. Is it pretty much copy pasting that line of code you have there into keyboard.xml and assign a key combination to it through that xml?
I have just been through the same thing.. I have a Lenovo Mini Wireless that doesn't have function keys using xbmc-standalone i needed to pull out my keyboard to get to a virtual terminal which was annoying! it took a while for me to figure this out so hopefully I can save some other newbies some time.

first you need to make a simple bash script

copy the below into a text file and save as 'tty1' in an easily accessible folder (i saved it in my .xbmc/userdata folder

Code:
#!/bin/bash
#

gksudo chvt 1

exit

right click on tty1 and make sure in permissions you have the run as executable ticked.

if you run that script now it should take you to tty1, if not there is something wrong.

Now in your userdata/keymaps folder you will need to open keyboard.xml in a text editor (https://github.com/xbmc/xbmc/tree/master/system/keymaps - i downloaded mine from here) and add the following line in the global keyboard area

Code:
<one mod="ctrl,alt">System.Exec("/home/simon/.xbmc/userdata/tty1")</one>

you will need to update the path in the above code to where you saved your tty1 script
save and reboot into xbmc

now when you hit ctrl alt 1 you will hopefully be taken to tty1

the only downside is it puts xbmc into windowed mode but that is easily fixed by pushing your " ' " key.

I also removed the requirement to enter the sudo password when running chvt commands..

at your own risk - you can also do this by running in terminal 'sudo visudo' and adding at the bottom

Code:
%usergroup ALL = NOPASSWD: /bin/chvt

changing 'usergroup' to whatever your usergroup is called

Smile