Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Hardware & Laptops
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Hardware & Laptops
Problems with hardware & laptops not being detected or supported during or after install.

 
 
Thread Tools Display Modes
Old June 20th, 2007   #1
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Keymapping Buttons with No Xev Event

I have a gyration MCE remote. Out of the box, the arrows, numbers, mouse, and enter/esc buttons worked. In xev, the basic multimedia functions were recognized (play, pause, volume, skip, previous, stop), and even the volume keys worked in kde. However, there are other keys on the remote that don't even generate anything in xev when I hit them. Some of these are the input key, channel up/down keys, and menu key. Is there a way to map these keys if xev doesn't catch them? I assume right now the remote is just using the build-in USB keyboard and mouse drivers (usb_hid). Do I need to set up LIRC, even though the remote is RF and not IR?

Last edited by napsilan; June 24th, 2007 at 10:26 AM..
napsilan is offline  
Old June 21st, 2007   #2
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

starting to answer my own question. http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys says that I need to check dmesg and edit /etc/conf.d/local.start
Quote:
Originally Posted by gentoo wiki
If pressing a key doesn't do anything at all (ie, xev produeces no output), run the following command in an X terminal:

dmesg

You will probably see some lines like these:

Output of dmesg
Code:
atkbd.c: Unknown key released (translated set 2, code 0x96 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e016 <keycode>' to make it known.

This means that the kernel doesn't have keycodes mapped to your keyboard's scancodes. You will have to add one line in /etc/conf.d/local.start for each missing key as follows:

/etc/conf.d/local.start
Code:
setkeycodes e008 136
setkeycodes e016 150
... And so on ...

Where the first number (e008) is what you see in dmesg, and the second number (136) is an unused keycode in your kernel. In general you can find a good keycode by taking the last 2 digits of this first number, converting it from hex (base-16) to decimal (base-10) and adding 128.
/etc/conf.d/local.start isn't used in ubuntu, I think it's /etc/rc.local instead

Last edited by napsilan; June 21st, 2007 at 10:11 AM..
napsilan is offline  
Old June 21st, 2007   #3
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

looks like evrouter does the trick for most keys

http://www.bedroomlan.org/~alexios/coding_evrouter.html

I attached the evrouter dump codes for the remote. I still can't get any output from the "TV home", "setup menu", "Last" and "Input" keys.
Attached Files
File Type: txt Evrouter_gyration.txt (6.6 KB, 351 views)

Last edited by napsilan; June 21st, 2007 at 10:08 PM..
napsilan is offline  
Old June 22nd, 2007   #4
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

it looks like evrouter doesn't work with openbox for some reason.

Code:
xlib: connection to ":0.0" refused by server
xlib: no protocol specified

evrouter: could not open display ":0.0"
Anyone know how to get xlibs or whatnot working with openbox?
napsilan is offline  
Old June 22nd, 2007   #5
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

needed to run

xhost +local:root

to fix that issue. Still not getting it to correctly autostart though. My /home/mythtv/.config/openbox/autostart.sh looks like

xhost +local:root &
sudo evrouter --config=...... /dev/input/......

I have the mythtv user set to sudo both autostart.sh and evrouter w/o a password.
napsilan is offline  
Old June 22nd, 2007   #6
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

Got it working, although this is probably NOT the "proper" way to do it.

I left /home/mythtv/.config/openbox/autostart.sh as it was
Code:
xhost +local:root
killall evrouter
sudo rm /tmp/.evrouter*   #removes a previous lock file
sudo evrouter --config=/home/mythtv/Evrouter_gyration.txt /dev/input/by-id/usb-Gyration_Gyration_RF_Technology_Receiver-event-mouse /dev/input/by-id/usb-Gyration_Gyration_RF_Technology_Receiver-event-kbd &
Then I set it so that the mythtv user could sudo both evrouter and rm without a password. This was done with visudo. Having a password-less rm is the thing that made me save this idea for last. If anyone has a better way to allow the mythtv user to delete the evrouter lock file, please say so.
Code:
mythtv ALL=NOPASSWD: /usr/bin/evrouter
mythtv ALL=NOPASSWD: /bin/rm
Finally I added the autostart file to the end of the /usr/share/mythtv/startmythtv.sh file, right before "exec mythfrontend." This is the script called by the mythtv-xsession.desktop file. For some reason, the autostart script wasn't being run normally, so this was needed.
Code:
sh /home/mythtv/.config/openbox/autostart.sh &
#start mythtv frontend software
exec mythfrontend
This finally automatically starts up evrouter correctly on login and lets it map the remote keys (except those 4 that it didn't recognize).

I attached the evrouter deb and my current config file if anyone wants them.
Attached Files
File Type: txt Evrouter_gyration.txt (6.7 KB, 353 views)
File Type: deb evrouter_0.3.3_i386.deb (24.0 KB, 140 views)
File Type: gz evrouter_0.3.3.tar.gz (227.3 KB, 131 views)

Last edited by napsilan; June 22nd, 2007 at 11:44 PM..
napsilan is offline  
Old October 7th, 2007   #7
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

everytime mythtv updates, I have to re-edit the startmythtv file again.
napsilan is offline  
Old October 9th, 2007   #8
modulok
5 Cups of Ubuntu
 
Join Date: Dec 2006
Beans: 42
Re: Keymapping

wow, a whole thread talking to yourself...good stuff though!

I found the remote/keyboard combo on buy.com for cheap ($65) and was thinking about getting both. Right now I use the Logitech Dinovo Edge and trying to get the ATI Remote Wonder to work (without much success in mythtv).

Wondering how the remote works with mythtv (0.20.2)...and do you have the universal one? does it connect nicely to other components?
modulok is offline  
Old October 9th, 2007   #9
napsilan
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 120
Ubuntu 7.10 Gutsy Gibbon
Re: Keymapping

Quote:
wow, a whole thread talking to yourself...good stuff though
Yah basically. Started out as a request for help but I figured that others might find the info useful

I think my remote is slightly unique in that it registers as a keyboard and mouse, not as an actual remote. Have you tried looking at the LIRC info? That is the program/module that takes care of IR remotes, which I believe the ATI remote is.

Can you get any input from your remote at all? For example, if you are in a terminal and hit the numbers on your remote, will it enter those numbers into the terminal? Or does it not work at all? Mine was able to do that right when I plugged it in, so I just had to keymap the wierd keys, not get the whole thing working.

LIRC page
http://mythtv.org/wiki/index.php/LIRC

ATI remote wonder pages, depending on which model you have
http://mythtv.org/wiki/index.php/ATI_Remote_Wonder
http://mythtv.org/wiki/index.php/ATI_Remote_Wonder_II
http://mythtv.org/wiki/index.php/ATI_Remote_Wonder_Plus

Last edited by napsilan; October 9th, 2007 at 12:12 PM..
napsilan is offline  
Old October 10th, 2007   #10
modulok
5 Cups of Ubuntu
 
Join Date: Dec 2006
Beans: 42
Re: Keymapping

yup, that first link is the remote I have....but I just ordered the gyration kb/universal remote combo.

IS that the remote you have, the gyration universal media center remote?
http://www.gyration.com/c-3-remotes.aspx - I got the combo coming, but remote is the same in both I think.
modulok is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:10 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry