Topic: Set volume control keys on Toshi Equium?? [SOLVED]

The volume control wheel on my laptop (Toshiba Equium P300) is broken so I would like to set some keyboard keys to do the same thing, like they do on a Mac.

Casting around a bit on the forum it seems possible, but I am a newb at these things so I am probably oversimplifyling it massively.  Anyway I have edited my rc.xml to include the following text -



<keybind key="C-51">
      <action name="Execute">
      <execute>amixer -q set PCM 10- unmute</execute>
      </action>
    </keybind>
    <keybind key="C-52">
      <action name="Execute">
      <execute>amixer -q set PCM 10+ unmute</execute>
      </action>
    </keybind>
    <keybind key="C-50">
      <action name="Execute">
      <execute>amixer -q set PCM 0</execute>
      </action>
    </keybind>


(Where keys 50 to 52 are [m], [<] and [>] respectively.  Which I found out using a CLI command- 'keycode' or something like that).    - edit - I tried xev and it gave me different numbers - 58-60.  I tied these as well but still no good -  I also tried the actual keys (ie C->) but this didn't work either.


So, is this possible?  if so what am I doing wrong?  Something to do with the mixer??

Thanks in advance

Spoov

Last edited by spoovy (2010-01-04 13:19:53)

Re: Set volume control keys on Toshi Equium?? [SOLVED]

Try this: create a ".Xmodmap" file in your home directory and paste in this:

keycode 50 = F21
keycode 51 = F22
keycode 52 = F23

Then you use the new F2x codes like <keybind key="C-F21">.

edit: BTW for the M key at least you don't need to do this you can just use <keybind key="C-m">

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Set volume control keys on Toshi Equium?? [SOLVED]

Thanks, but...

I don't have F keys beyond F12, would any Fkeys do the same job?  If so why not use the < an > keys instead?

I tried to use keybind C-m but it still didn't do anything.

Re: Set volume control keys on Toshi Equium?? [SOLVED]

It doesn't matter that those F keys don't exist.

Also did you make sure to go to Openbox menu > Preferences > Openbox Config > Reconfigure after making changes to your rc.xml file?

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Set volume control keys on Toshi Equium?? [SOLVED]

OK I did all that, but still no volume control.  Plus the 'm', '<' and '>' keys don't do anything at all with that .Xmodmap file in place.  I've had to hash it out to get those keys working again.

Last edited by spoovy (2009-12-14 19:39:02)

Re: Set volume control keys on Toshi Equium?? [SOLVED]

till no joy with this but i'm gonna bump it cos it is still really griping me.   I thought there might be a way to steal the required text from  elsewhere.

Basically in rhythmbox, C+up and C+down control the volume of rhythmbox, as i would like them to do for the master volume control.   Also, I have ubuntu 9.10 installed on this pc, on which i have set the keys up so the up arrow increases volume and down decreases, again exactly as i would like in #!.   In ubuntu this is done with a GUI. 

Is there some way i can get into the config files either for rhythmbox or maybe ubuntu and steal the text or something? 

Cheers

Last edited by spoovy (2010-01-04 00:15:47)

Re: Set volume control keys on Toshi Equium?? [SOLVED]

first run xev then type your key

the third line should give you something like 'keycode 60  (keysym 0x3e, greater)'
'greater' is the keyname that you want to use in the shortcut in your rc.xml

so in the rc.xml i could just  literally put "greater" as the key rather than c-51 etc although i would suggest something like "W-greater" (windows/super key - <), or W-period  so you can still use the '<' key as intended.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Set volume control keys on Toshi Equium?? [SOLVED]

tried that, nothing doing.    any merit in my idea of finding the required text from elsewhere?

Thanks

Re: Set volume control keys on Toshi Equium?? [SOLVED]

You mentioned you want C-Left and C-Right to handle the Master volume, so try this:

    <keybind key="C-Down">
      <action name="Execute">
        <execute>amixer set Master toggle -q</execute>
      </action>
    </keybind>
    <keybind key="C-Left">
      <action name="Execute">
        <execute>amixer set Master 3+ -q</execute>
      </action>
    </keybind>
    <keybind key="C-Right">
      <action name="Execute">
        <execute>amixer set Master 3- -q</execute>
      </action>
    </keybind>

As is usually the case in Linux, capitalization is important.  Also, those particular codes are typically used for cursor movement in text editors, so if you have a "Super" key, it's better to use "W-Up" etc.

If you want to stick with "m" for mute and less than and greater than, remember that the unshifted values are comma and period, respectively. wink  (Again note the capitalization, or in this case, the lack thereof.)

while ( ! ( succeed = try() ) );

Re: Set volume control keys on Toshi Equium?? [SOLVED]

bingo I got it!   A combination of all your advice helped so thanks, but it appears the main problem was my mixer control text, as i suspected.    I changed the rc file to read as so -

<keybind key="C-less">
      <action name="Execute">
      <execute>amixer -c 0 set Master 5%- unmute</execute>
      </action>
    </keybind>
    <keybind key="C-greater">
      <action name="Execute">
      <execute>amixer -c 0 set Master 5%+ unmute</execute>
      </action>
    </keybind>
    <keybind key="C-m">
      <action name="Execute">
      <execute>amixer -c 0 set Master 100%- unmute</execute>
      </action>
    </keybind>


Finally!!

Re: Set volume control keys on Toshi Equium?? [SOLVED]

It seems different sound chips respond to slightly different command strings; now we know what works with the Toshi Equium.  Glad this is finally sorted!

while ( ! ( succeed = try() ) );