Find the answer to your Linux question:
Results 1 to 4 of 4
For the past 20 hours, I've been searching for a solution on getting the volume wheel on the side of my laptop to work. I've heard that this works on ...
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6

    Linux Key Events

    For the past 20 hours, I've been searching for a solution on getting the volume wheel on the side of my laptop to work. I've heard that this works on certain mixers as a feature but of course I can't seem to find descriptions of this in any mixer features list. As a result, I decided to just add some functionality to my current mixer (xfce4-mixer) if it needs it (since I'm not sure if I just missed something or what). The only conflict currently is I have no clue on how to handle key events! I'm sure I could add a service that watched out for my volume wheel to move and then change the volume through whatever method the mixer uses but I'm new to programming in Linux. Anyone care to help?

  2. #2
    Linux Newbie
    Join Date
    Nov 2007
    Location
    Planet Earth
    Posts
    152
    Hi,

    You need first to check if your special key is recongnized... you can use the 'xev' program, which can monitor any keyboard or mouse event. Start the program from a terminal and keep the focus on the little window that opens. Move the mouse, press some keys and see the output; now, press your keyboard's special keys: if there is an output it means that you can work with those keys, otherwise, you need to figure how to make it work (i.e. googling for your keyboard brand and model on linux ).

    Now, if the keys are working, depends on your desktop environment how to handle the events with or without programming... for example, in KDE there is a configuration for global key bindings, and normally I make a script to control some feature and bind to a key using that configuration.

    I hope this helps,

    Hugo
    EOF

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    As hugortega says, use xev to see if your volume wheel is recognized. If it is, then you can try his approach.

    If it is not, or if you are using a WM that doesn't support special keys (i.e. Fluxbox, etc.), you can look into software like LinEAK or KeyTouch. These are WM-independent, and have sometimes figured out how to work keys that are not detected automatically by xev.
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6
    I'm a bit confused actually. I know my wheel works because it sends a signal call XF86VolumeUp / Down. Does it send other events? I should be able to catch events outside of X. My original plan was to simply make my mixer a service and then have it catch my wheel events. That should work pretty effeciently I believe (since I've never tried this before). I was also hoping I could get something that doesn't rely on X since I try and turn X off when I'm on a battery.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...