[EN] HP Pavilion multimedia buttons configuration under Linux - QuickPlay for Ubuntu Linux

HP Pavilion multimedia buttons configuration under Linux

How to setup the HP QuickPlay Linux equivalent: Elisa Media Center

In this howto you’ll learn how to customize the applications associated to the sensitive buttons above the keyboard of HP Pavilion laptops. This way you would be able to run Elisa Media Center (HP QuickPlay Linux equivalent) simply touching the QuickPlay button.

1. simple method

You can simply customize these touch sensitive buttons for most common functions through the Gnome applet under System -> Preferences -> Keyboard shortcuts

2. advanced method

The first step is finding out the button keycode in order to be able to bind an event to it: on the terminal shell you have to run this applet (if not available it should be installed through x11-utils package with synaptic package manager or sudo apt-get install x11-utils)

xev

now push/touch the desired button

You should get an output similar to the following one:

For every pressed button you’ll get two events, one for the push event, one for the release event.

Just for your information Quickplay button has keycode 170 (dv6000 series) 205 (dv9000 series), DVD button has keycode 219 (dv6000 series) 237 (dv9000 series)

Now we have to bind a name to the keycode. Just create in your own home directory a file called .Xmodmap (notice the initial dot and the capital X):

keycode 219 = F13
keycode … = F14
keycode … = firefox

At every line you are going to write the keycode (keycode 219) associated with (=) the name (F13); you can choose whatever name you like, however it is far easier to choose one betweenn F13 and F24. Otherwise you’ll have to define the new buttons in /usr/X11R6/lib/X11/XKeysymDB by writing at the end of the file something like this:

firefox :10090000

which is the name we choose followed by a colon and an exadecimal number not used in any other line of the file.

At this point we hav eto run:

xmodmap .Xmodmap

and again run xev. If you have done things well you’ll see and output similar to this one:

.Xmodmap is going to be run at each Xorg startup.

Now you have to associate an application to your newly configured button.

I advise you to associate Elisa media center to the QuickPlay button. It is a very good alternative to HP QuickPlay for linux systems. You can install Elisa by running sudo apt-get install elisa . The command to run this media center is, guess what, elisa

You can read a more comprehensive guide about Elisa Media center here

There are 3 ways to bind a program to a button or combination of buttons according to what window manager you are using

A) Gnome Metacity (no desktop effects enabled)

  1. ALT+F2
  2. gconf-editor
  3. go to apps -> metacity -> keybinding_commands
  4. doubleclick on command_1
  5. fill the area with the application name (the one you type in to execute it) i.e. gcalctool for GNOME calculator
  6. go to apps -> metacity -> global_keybindings
  7. doubleclick on run_command_1
  8. set the button (or key combination) you want to bind to the program i.e. F13 or <Control><Alt>C
  9. Note the parenthesis < > for the funcion button
  10. you can set up all the shortcuts you want with strings command_N and run_command_N
  11. done!

B) Gnome Compiz (desktop effects enabled)

same as above, only keys change:

apps -> compiz -> general -> allscreens -> options

string names are command0 (for the application command) and run_command0_key (for the button name or key combination).

C) KDE

run kmenuedit, select the desired program on the left menu and then on the right click to Nothing under section Currnet Key. As soon as a window opens press/touch the button you want to bind to. Done.

You can also manually modify the config file

~/.kde/config/khotkeyrc

Here is an example

[Main]
Num_Sections=2
Version=1
[Section1]
MenuEntry=true
Name=K Menu - Networking/WWW/Mozilla.desktop
Run=Networking/WWW/Mozilla.desktop
Shortcut=Mozilla
[Section2]
MenuEntry=true
Name=K Menu - Home.desktop
Run=Home.desktop
Shortcut=F13
| Print This Post Print This Post | Email This Post Email This Post
RSS 2.0 | Trackback | Comment

15 Responses to “[EN] HP Pavilion multimedia buttons configuration under Linux - QuickPlay for Ubuntu Linux”

Comments

  1. Dan says:

    Thank you for the tip. It worked like a charm.

    I would like to note that on a dv9000 the autoplay button code is 205 and the DVD one is 237.

  2. aldeby says:

    Happy to hear it worked!
    I have just updated the post with the key codes you reported, thanks!

  3. Travis Place says:

    I have just checked again, and on the DV2839TX ‘Special Edition’ atleast, in both Ubuntu and Kubuntu, the Quickplay and DVD buttons do not work. xev does NOT see them :(

  4. BeMons says:

    Same issue for me, DV2000 Quickplay and DVD does not launch a event on xev when i press it.

  5. semola says:

    Thank you for your tutorial !
    On HP Pavillon dv2750eb Quickplay, DVD buttons and all buttons on the remote control don’t produce
    any scancodes with the command showkey -s (without X launched).

  6. kurei says:

    Hi,

    thanks for the article, it was very useful. I was already getting frustrated on trying to
    associate elisa with the quick play button. Your article worked like a charm.

    One thing, i noticed that quickplay creates instances of elisa every time i press the button
    in the remote control. I know that this is rather an elisa issue. I was wondering if you know
    a work around for this…

    Regards,

    Kurei

  7. Travis Place says:

    Write a small bash script that creates a lockdir, and then runs Elisa. Map the quickplay button to that bash script.. When the bash script runs, if it finds the lockdir already exists, the script just exits (doesnt rerun Elisa).

    If you need help creating such a script, let me know.

  8. Travis Place says:

    Something like this should suffice.. call it ‘run-elisa’ or something, and put it in /usr/local/bin/

    —SNIP—

    lockdir=/tmp/elisa.lock
    if mkdir “$lockdir” 2>/dev/null
    then
    /path/to/elisa
    # Remove lockdir when the script finishes, or when it receives a signal
    trap ‘rm -rf “$lockdir”‘ 0 # remove directory when script finishes
    trap “exit 2″ 1 2 3 15 # terminate script when receiving signal
    else
    exit 0
    fi

    —SNIP—

    It will run, and create a lockdir then run elisa. if its run again, the lockdir already exists, so the script just exits.
    If you cleanly close elisa, or send it a signal (kill etc) the lockdir is removed, so it will run next time.

  9. kurei says:

    hi,

    Thanks for your response. How do i do this? should i simply copy and paste your
    codes to a new file for example run-elisa.sh? then replace the path/to/elisa? Please advise.

    Regards,

    Kurei

  10. semola says:

    kurei, you have to copy the code into a new file run-elisa.sh and store it into /usr/local/bin.
    You have to check where is the elisa binary (with the commande locate bin/elisa)
    and change /path/to/elisa with that value.

    On my HP Pavillon dv2750eb Quickplay, DVD buttons and all buttons on the remote control don’t produce
    any scancodes with the command showkey -s (without X launched). Does it mean that it’s impossible
    to use those keys or can I hope change the keymap of the kernel or something else, maybe an
    hardware malfunction ?

  11. Travis Place says:

    semola, I have a DV2839TX, and got no response from “DVD” or “Quickplay” buttons, yet my remote works. Well, except for the DVD and Quickplay buttons on it. I am looking into it.. It seems the problem goes fairly deep (ie, kernel)

    As far as i can tell, the kernel driver itself has to be ‘informed’ of these keys.

    In regards to the little script i wrote, i could tidy this up (the above one was quickly knocked up).

    Do you think its worth making a cleaner (perhaps configurable) one ?

  12. Travis Place says:

    Unfortuntely I am still having the issue of my ‘DVD’ and ‘Quickplay’ buttons not sending any keycodes/events, so they cannot be mapped to anything.. Any ideas on this ?

  13. eskararriba says:

    I have a dv2700, and exactly the same problem as travis place - unfortunately, without any solution yet;
    no idea whatt to do about it, but I m counting on all of you … cheers

  14. Davie says:

    Same problem here with a DV1000 remote - following this with interest. Thanks folks.

  15. semola says:

    For those 2 buttons, I think it’s a kernel issue and we have to write a bug report for it.

    My remote control does not work, it’s very strange because a friend has a HP Pavillon dv6799eb (under windows) and his remote works well on my laptop (except the DVD and QuickPlay buttons) and my remote control works on his laptop. How it’s possile ?

    PS : my model is HP Pavillon dv2750eb


Leave a Reply

  • Page visits

    • 5635
  • Polls

    Did you manage using the internal modem?

    View Results

    Loading ... Loading ...
  • Categories

  • Meta

  • Recent Comments

  • Archives

  • Most Visited

  • Linux On Laptops

    -->