Author Topic: Solved: Xmms With Ce-rh2 Remote Control?  (Read 4967 times)

MONVMENTVM

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« on: November 02, 2005, 01:15:24 pm »
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").
« Last Edit: November 02, 2005, 03:41:48 pm by MONVMENTVM »
Device: Zaurus C3100
OS: testing pda[span style=\'font-size:13pt;line-height:100%\']X[/span]rom beta4
Window Manager: Xfce4 + ROX Desktop and Filer
WLAN: D-Link DCF-660W
Memory: Kingston 512MB SD
Creative Wired Remote modified to work as CE-RH2

muramas

  • Newbie
  • *
  • Posts: 5
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #1 on: November 12, 2005, 09:20:55 pm »
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  )

vlad

  • Newbie
  • *
  • Posts: 23
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #2 on: July 13, 2006, 11:10:19 pm »
Quote
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").
[div align=\"right\"][a href=\"index.php?act=findpost&pid=101916\"][{POST_SNAPBACK}][/a][/div]
sorry for stupid question but where it should be describe and could you please paste here that part of config for Xmms.
Thanks

Craigms

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • http://
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #3 on: July 14, 2006, 12:33:34 am »
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
Sharp Zaurus SL-C3200
GlobalSat BC-337 GPS CF Card

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #4 on: July 14, 2006, 12:36:23 am »
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=135087\"][{POST_SNAPBACK}][/a][/div]

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...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

MONVMENTVM

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #5 on: July 14, 2006, 05:48:22 am »
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.
Device: Zaurus C3100
OS: testing pda[span style=\'font-size:13pt;line-height:100%\']X[/span]rom beta4
Window Manager: Xfce4 + ROX Desktop and Filer
WLAN: D-Link DCF-660W
Memory: Kingston 512MB SD
Creative Wired Remote modified to work as CE-RH2

vlad

  • Newbie
  • *
  • Posts: 23
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #6 on: July 14, 2006, 04:25:34 pm »
thnks guys. I'm just not sure where to change mapping in config (how?) or source code.

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #7 on: July 14, 2006, 08:25:19 pm »
Quote
thnks guys. I'm just not sure where to change mapping in config (how?) or source code.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=135169\"][{POST_SNAPBACK}][/a][/div]

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: [Select]
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;
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

MONVMENTVM

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #8 on: July 15, 2006, 04:16:54 am »
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.
Device: Zaurus C3100
OS: testing pda[span style=\'font-size:13pt;line-height:100%\']X[/span]rom beta4
Window Manager: Xfce4 + ROX Desktop and Filer
WLAN: D-Link DCF-660W
Memory: Kingston 512MB SD
Creative Wired Remote modified to work as CE-RH2

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Solved: Xmms With Ce-rh2 Remote Control?
« Reply #9 on: August 28, 2006, 04:53:49 pm »
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
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM