Help - Search - Members - Calendar
Full Version: Solved: Xmms With Ce-rh2 Remote Control?
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
MONVMENTVM
Hello,

I am having a ce-rh2 but dont know how to make it working in xmms with rc12.

need help pls,

thanks in advance,
MONVMENTVM

EDIT: solved it my self. just had to type "xev" into konsole and press every key of the remote. so i got the keycode of every key. into xmodmap i wrote this keycodes coresponding to the keyboardshortcuts of xmms. for example: keycode 72 = V (this is the key STOP of the remote and the shortcut of stop in xmms is "V").
muramas
In case anyone's looking for them, here are the keycodes I recorded for the CE-RH2:

Volume up: 118
Volume Down: 119
Mute: 120
Play/Pause: 64
Stop: 68
Previous: 116
Next: 108

I'm trying to get it to work in Opie now; a less-than-ideal workaround for the moment is to map play to "space", previous to "Left", next to "Right", and stop to "escape"; this will at least work if mediaplayer is already open and has the focus (I think a better solution would be to capture these outside the player and send the appropriate signals; that way volume could be controlled outside the player, and hitting "play" could launch the player if necessary.. if anyone else has any clues on how to do this, let me know smile.gif )
vlad
QUOTE(MONVMENTVM @ Nov 2 2005, 10:15 AM)
Hello,

I am having a ce-rh2 but dont know how to make it working in xmms with rc12.

need help pls,

thanks in advance,
MONVMENTVM

EDIT: solved it my self. just had to type "xev" into konsole and press every key of the remote. so i got the keycode of every key. into xmodmap i wrote this keycodes coresponding to the keyboardshortcuts of xmms. for example: keycode 72 = V (this is the key STOP of the remote and the shortcut of stop in xmms is "V").
*

sorry for stupid question but where it should be describe and could you please paste here that part of config for Xmms.
Thanks
Craigms
XMMS already has shortcut keys that work as long as the window is active.

Z Previous Track
X Play/Restart/Unpause
C Pause/Unpause
V Stop
B Next Track
Meanie
QUOTE(Craigms @ Jul 14 2006, 02:33 PM)
XMMS already has shortcut keys that work as long as the window is active.

Z  Previous Track
X  Play/Restart/Unpause
C  Pause/Unpause
V  Stop
B                              Next Track
*


what needs to be done is to modify the xmms code to listen to the CE-RH2 keys. this is not difficult to do if anyone can be bothered doing it...
MONVMENTVM
Yes it's not a hard thing to do... just define the keycode to the corresponding shortcuts for xmms (just look in xmms which key means play, pause stop and so on... i do not know them right now).

The problem is that beta4 doesn't recognize the ce-rh2.
vlad
thnks guys. I'm just not sure where to change mapping in config (how?) or source code.
Meanie
QUOTE(vlad @ Jul 15 2006, 06:25 AM)
thnks guys. I'm just not sure where to change mapping in config (how?) or source code.
*


you can edit the source and recompile. here's the source segment of interest. in main.c of the xmms source tarball you will need to modify the source under the mainwin_keypress (GtkWidget * w, GdkEventKey * event, gpointer data) function

CODE
gboolean mainwin_keypress(GtkWidget * w, GdkEventKey * event, gpointer data)
{
    switch(event->keyval)
    {

       // added OK/Enter key to activate play
    case GDK_Return:
    case GDK_KP_Enter:
 mainwin_play_pushed();
 break;

       // added Cancel/Escape key to activate stop
    case GDK_Cancel:
    case GDK_Escape:
 mainwin_stop_pushed();
 break;

       // reassigned volume down to N key
       case GDK_N:
       case GDK_n:
 mainwin_set_volume_diff(-2);
 break;

       // reassigned volume up to M key
       case GDK_M:
       case GDK_m:
 mainwin_set_volume_diff(2);
 break;

       // reassigned Down key to go previous track
    case GDK_Up:
    case GDK_KP_Up:
               playlist_prev();
 break;

       // reassigned Up key to go next track
    case GDK_Down:
    case GDK_KP_Down:
               playlist_next();
 break;

    case GDK_Left:
    case GDK_KP_Left:
 if(playlist_get_current_length() != -1)
     input_seek(CLAMP(input_get_time() - 5000, 0, playlist_get_current_length()) / 1000);
               break;

    case GDK_Right:
    case GDK_KP_Right:
 if(playlist_get_current_length() != -1)
     input_seek(CLAMP(input_get_time() + 5000, 0, playlist_get_current_length()) / 1000);
 break;

    default:
     break;
     
    }
     
    return TRUE;
}


The above enables you to use OK and CANCEL (both the ones on the keyboard and those two buttons on the back/side of the Z) to play and stop in addition to pressing X and C. It also allows you to use UP and DOWN (again on the keyboard and the back/side keys) to change between song tracks.
You can easily add the key symbol for the ce-rh2 to the above, ie

change from
QUOTE
case GDK_Return:
case GDK_KP_Enter:
  mainwin_play_pushed();
  break;


to
QUOTE
case GDK_Return:
case GDK_KP_Enter:
        case GDK_XF86AudioPlay:
  mainwin_play_pushed();
  break;
MONVMENTVM
What about /etc/X11/kb/{your_machine}/xmodmap?

It is alot easier to do this as you just need to open it with an editor, and then restart.
desertrat
I was playing with xmms just now and was pleasantly surprised that the IR remote control plugin actually works! Not very practical but fun nevertheless smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.