Discussion:
Assigning action to keys
(too old to reply)
Jean F. Martinelle
2022-11-14 00:42:24 UTC
Permalink
I am running XFCE under Slackware 15.0. My keyboard has two keys
that are obviously meant to mute and unmute the sound in my system.
However, when I press them nothing happens.

While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will do
what they are supposed to do.

Can anybody supply pointers on how to pull this off?
John Forkosh
2022-11-14 03:44:25 UTC
Permalink
Post by Jean F. Martinelle
I am running XFCE under Slackware 15.0. My keyboard has two keys
that are obviously meant to mute and unmute the sound in my system.
However, when I press them nothing happens.
While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will do
what they are supposed to do.
Can anybody supply pointers on how to pull this off?
Not sure, but maybe try xmodmap -pk | grep Mute to find the
appropriate keycode, which seems to be 121 for my keyboard
(but I'm not seeing anything that looks like "Unmute"; maybe
you're just supposed to press Mute a second time?). Anyway,
now use xev and press the key you think should be Mute,
and see if its displayed keycode actually is your Mute keycode.
Suppose it's not... suppose it's, say, 66, and from xmodmap
you know Mute should be 121. Then xmodmap -e "keycode 66 = Mute"
should re-assign the key you want to be Mute so that it actually is.
Same idea for Unmute, I suppose, but like I said, I'm not seeing
any Unmute key for my keyboard.
--
John Forkosh ( mailto: ***@f.com where j=john and f=forkosh )
Jean F. Martinelle
2022-11-14 17:12:20 UTC
Permalink
Post by John Forkosh
Post by Jean F. Martinelle
I am running XFCE under Slackware 15.0. My keyboard has two keys
that are obviously meant to mute and unmute the sound in my system.
However, when I press them nothing happens.
While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will
do what they are supposed to do.
Can anybody supply pointers on how to pull this off?
Not sure, but maybe try xmodmap -pk | grep Mute to find the
appropriate keycode, which seems to be 121 for my keyboard (but I'm not
seeing anything that looks like "Unmute"; maybe you're just supposed to
press Mute a second time?). Anyway,
now use xev and press the key you think should be Mute,
and see if its displayed keycode actually is your Mute keycode. Suppose
it's not... suppose it's, say, 66, and from xmodmap you know Mute should
be 121. Then xmodmap -e "keycode 66 = Mute" should re-assign the key
you want to be Mute so that it actually is.
Same idea for Unmute, I suppose, but like I said, I'm not seeing any
Unmute key for my keyboard.
Thanks. Actually, I was wrong: they are not mute and unmute keys,
but audio volume up and down keys:

$ xmodmap -pk | grep -i volume
122 0x1008ff11 (XF86AudioLowerVolume) 0x0000
(NoSymbol) 0x1008ff11 (XF86AudioLowerVolume)
123 0x1008ff13 (XF86AudioRaiseVolume) 0x0000
(NoSymbol) 0x1008ff13 (XF86AudioRaiseVolume)

And, in fact, they already do what they are supposed to do: I never
noticed this before because I keep my audio framework on mute by default.
Joseph Rosevear
2022-11-20 21:13:39 UTC
Permalink
I am running XFCE under Slackware 15.0. My keyboard has two keys that
are obviously meant to mute and unmute the sound in my system. However,
when I press them nothing happens.
While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will do
what they are supposed to do.
Can anybody supply pointers on how to pull this off?
I have already encountered and solved a similar problem in Fvwm2, not
XFCE. Perhaps some of what I did will apply. Here is the code I put
into my ~/.fvwm2rc file--the Fvwm2 configuration file:

# Mute
# Key F8 A N Exec :
Key XF86AudioMute A N Exec :

# Volume down
Key F9 A N Exec /usr/local/bin/changevol down
Key XF86AudioLowerVolume A N Exec /usr/local/bin/
changevol down

# Volume up
Key F10 A N Exec /usr/local/bin/changevol up
Key XF86AudioRaiseVolume A N Exec /usr/local/bin/
changevol up

My purposes were different, as I turned off the mute capability. Volume
up and down I treated by use of my own script /usr/local/bin/changevol--
let me know if you need the script. I captured key presses of both the
built-in keys and F9 and F10, as some keyboards lack the built-in keys.

I hope this helps.
Joseph Rosevear
2022-11-20 21:17:53 UTC
Permalink
I am running XFCE under Slackware 15.0. My keyboard has two keys that
are obviously meant to mute and unmute the sound in my system. However,
when I press them nothing happens.
While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will do
what they are supposed to do.
Can anybody supply pointers on how to pull this off?
Hello, by mistake I replied to a reply instead of directly to your
post. You can find my reply below.
Joseph Rosevear
2022-11-20 21:22:18 UTC
Permalink
Post by Joseph Rosevear
I am running XFCE under Slackware 15.0. My keyboard has two keys that
are obviously meant to mute and unmute the sound in my system. However,
when I press them nothing happens.
While this is hardly unexpected, I am sure there must be a way to
redefine those keys from XFCE so that when they are pressed they will
do what they are supposed to do.
Can anybody supply pointers on how to pull this off?
Hello, by mistake I replied to a reply instead of directly to your
post. You can find my reply below.
Oops. It seems I did reply directly. Sorry--I'm new to Pan.

Loading...