Multimedia Keys

CodeBlock

Active Member

Reaction score: 18
Messages: 216

I have a Logitech USB keyboard, and would like to get my multimedia keys playing nice. `xev` doesn't show anything for them, so I really have no clue where to start. Any insight?
 

graudeejs

Son of Beastie

Reaction score: 706
Messages: 4,617

here's example
~/.xmodmaprc
Code:
keycode 153 = XF86Favorites
keycode 178 = XF86HomePage
keycode 236 = XF86Mail
keycode 144 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay

then you need to assign shortcuts to these keys using these names
note: codes are keyboard dependant
 
OP
CodeBlock

CodeBlock

Active Member

Reaction score: 18
Messages: 216

killasmurf86 said:
here's example
~/.xmodmaprc
Code:
keycode 153 = XF86Favorites
keycode 178 = XF86HomePage
keycode 236 = XF86Mail
keycode 144 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay

then you need to assign shortcuts to these keys using these names
note: codes are keyboard dependant

Right, but I have no way of getting the codes because the media keys aren't recognized by xev or similar programs.
 

graudeejs

Son of Beastie

Reaction score: 706
Messages: 4,617

are you sure, xev doesn't show keycodes?
can you show screenshot [if it's possible to capture]

you can run xev in one terminal, and in other terminal run
Code:
$ sleep 10 && import -window root ~/screenshot.png
if you have ImageMagick installed
 
OP
CodeBlock

CodeBlock

Active Member

Reaction score: 18
Messages: 216

`xev` literally shows no output on the media keys, like they aren't recognized at all.... I'll attach a screenshot, but it's kind-of pointless as xev shows nothing.. It shows for the other keys, and for mouse, but nothing for the media keys:

*edit: okay, image was way too big to
url]
 

avilla@

Well-Known Member
Developer

Reaction score: 64
Messages: 258

i had the same problem, and found an old thread on the lists which said that xev(1) doesn't know about some keys... so i started a live archlinux, used $ showkey to record the keycodes, and now i'm going to add them to ~/.Xmodmap
that should work!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,970
Messages: 38,420

Also have a look at the keyboard Xorg detected. Some might not produce all the keycodes. I've had mixed results trying to get multimedia keys working with different keyboards.
 

aragon

Daemon

Reaction score: 282
Messages: 2,029

It only works with PS/2 keyboards AFAIK. I take it you're using a USB keyboard?
 
OP
CodeBlock

CodeBlock

Active Member

Reaction score: 18
Messages: 216

Yes, usb. I'll try booting a livecd and give that a shot like xzhayon said.
 

aragon

Daemon

Reaction score: 282
Messages: 2,029

I think you will have better luck if you connect your keyboard via a USB->PS2 adapter into the PS2 port.
 
OP
CodeBlock

CodeBlock

Active Member

Reaction score: 18
Messages: 216

The reason I can't do that is because it's a wireless keyboard and mouse combo, and only uses one usb port for the receiver, not one for keyboard and one for mouse... I guess it's kind of a lost cause for now, maybe worth submitting a PR and some driver hacker can look into it?
 

aragon

Daemon

Reaction score: 282
Messages: 2,029

Yea, go for it. I suspect it's one of those "bugs" that haven't annoyed enough people yet for it to be fixed. :)
 

mart

Member

Reaction score: 18
Messages: 48

@CodeBlock

You don't say exactly which logitech model this is (sadly, it matters). There was a similar thread here. Arch and Gentoo have good keycode lists for most models (that should transfer across assuming your particular model has decent kernel support, which isn't a given).

CodeBlock said:
I guess it's kind of a lost cause for now, maybe worth submitting a PR and some driver hacker can look into it?

Please do, but don't be surprised if their fix is ignored. My keyboard issue was 'fixed' years ago (PR patch), but has still not been integrated. I have to patch the kernel manually to get the use of function keys.
 

segin

New Member

Reaction score: 3
Messages: 5

I've a Compaq Internet Keyboard, 18 key variety, and I have discovered why your multimedia keys work on Linux and not FreeBSD, sorta.

It's like this: X gets it's mouse data from /dev/sysmouse and it's keyboard data from /dev/kbdmux0. All data from input devices passes through the FreeBSD kernel and ends up being fed to X from these endpoints. The FreeBSD kernel appears to be silently dropping keypresses for keys it doesn't recognize. 'xev' is reporting nothing because X isn't even receiving the keycodes as the kernel is dropping them before they get to X.
 

segin

New Member

Reaction score: 3
Messages: 5

segin said:
I've a Compaq Internet Keyboard, 18 key variety, and I have discovered why your multimedia keys work on Linux and not FreeBSD, sorta.

It's like this: X gets it's mouse data from /dev/sysmouse and it's keyboard data from /dev/kbdmux0. All data from input devices passes through the FreeBSD kernel and ends up being fed to X from these endpoints. The FreeBSD kernel appears to be silently dropping keypresses for keys it doesn't recognize. 'xev' is reporting nothing because X isn't even receiving the keycodes as the kernel is dropping them before they get to X.

Oh, as a solution, try using sysutils/uhidd as a user-mode input driver. According to the uhidd entry in the FreeBSD Wiki, this will give you what you want.
 

aragon

Daemon

Reaction score: 282
Messages: 2,029

segin said:
Oh, as a solution, try using sysutils/uhidd as a user-mode input driver. According to the uhidd entry in the FreeBSD Wiki, this will give you what you want.
Thank you! For the first time ever I can use the multimedia keys on my Logitech Wave keyboard. :)
 

hedgehog

Active Member

Reaction score: 20
Messages: 191

KDE4 users could try to choose their keyboard model (or similar) in the system settings.
System Settings - Regional & Language - Keyboard Layout - Keyboard model

This option allowed me to use all of the multimedia keys on my KB
 

hedgehog

Active Member

Reaction score: 20
Messages: 191

aragon said:
Is your KB a USB KB? Make & model?
nope, my keyboard is ps/2 KB: mitsumi, kfk-eb9hy. I chose "Logitech iTouch Internet Navigator Keyboard SE" to let my multimedia keys work. But there is also the same logitech model in the list, but for USB keyboard. I suppose it worth to try before installing any other drivers. Can't test it myself because I don't have an USB keyboard with media keys
 

indulekha

New Member


Messages: 9

I found that better than the multimedia keys is just installing xbindkeys and then you can create keybindings that do the multimedia stuff (I think gnome and kde users already have that functionality, but then they have to deal with bloatiness). Especially great when you have to use multiple machines, plus of course you're not limited to only multimedia tasks.
 

ikbendeman

Well-Known Member

Reaction score: 25
Messages: 357

aragon said:
Thank you! For the first time ever I can use the multimedia keys on my Logitech Wave keyboard. :)

How do you find out which ugen to use? My usb keyboard is on my laptop and thus it is built in so I can't just unplug and plug-in and watch dmesg for it...

usbconfig reports only:
Code:
ugen0.1: <OHCI root HUB ATI> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen1.1: <OHCI root HUB ATI> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen2.1: <EHCI root HUB ATI> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen3.1: <OHCI root HUB ATI> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen4.1: <OHCI root HUB ATI> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen5.1: <EHCI root HUB ATI> at usbus5, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen2.2: <HP Webcam Vimicro Co.,ltd> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen4.2: <product 0x0001 vendor 0x0a12> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen2.3: <USB2.0-CRW Generic> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
 
Top