This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Multimedia keys interpreted as alphabetic keys


On 14/04/2010 15:37, Chris Bird wrote:
I wonder if anyone could shed some light on this minor problem I have:

I'm using Cygwin/X as my X client for several linux boxes at work.
Everything's working fine (after some tweaking), but there is one small
thing I find very annoying:

The multimedia keys on my keyboard generate keypresses as though they
were normal keys. Specifically, Play/Pause generates a 'g', volume up
generates 'c', volume down generates 'b', and mute generates 'd'. The
keyboard is a logitech Internet 350. As I listen to music all day to
keep my sanity, and occasionally need to alter the volume or stop or
mute the track to join in a conversation in the office (or stop driving
other people mad with my relentless beats!), I often find these
keypresses being entered into whatever program I'm working on. Not ideal.

I used xev to find out what keycodes were being generated by these keys,
and by the keys the output would suggest is being pressed, ie. g, c, b,
and d, expecting to find different keycodes perhaps being mapped to the
same keysyms, so I could alter .Xmodmap to assign them to XF86Play, etc.
But I found that they were exactly the same, as if Cygwin was
interpreting them as the same keys at some very basic level, whereas
Windows can tell the difference between pressing g (outputs a 'g') and
pressing Play/Pause (it plays or pauses the current track in my media
player). Here is the output from xev when pressing Play/Pause, then g:

[snip]

They both output 'keycode 42 (keysym 0x67, g)'. I tried various settings in the arguments to XWin, to try to enable multimedia keys, and set the model of my keyboard and layout correctly:

%RUN% XWin -multiwindow -clipboard -silent-dup-error -xkbmodel
logitech_base
REM -xkbvariant extd
REM -xkbmodel logii350
REM -xkblayout gb

but none of these made any positive difference, in fact one of them (I
can't remember which), actually disabled some other keys (e.g. the arrow
keys).

This behaviour doesn't happen in non-X Cygwin. I tried using Xming get
some ideas as suggested in this similar-looking post

http://sourceware.org/ml/cygwin-xfree/2004-12/msg00249.html

('Xming.exe :1 -multiwindow -logverbose 10'), and got no useful messages
about the keyboard.

Has anyone got a clue what's going on? Hope someone can help.

Thanks for the clear problem report.


After doing a bit of testing, the issue here seems to be that XWin doesn't know to generate the correct X keycodes for these multimedia keys, so this is a bug in XWin, not a problem with the XKB layout selected.

I've added some some entries to the table which translates Windows Virtual Keycodes into X keycodes which hopefully fixes this.

Perhaps you could try out the test build I have uploaded at [1] and see if that resolves this problem for you?

I've also turned on a bit more debug, so even if this doesn't work correctly, -logverbose should indicate a bit more clearly what's going on...

[1] ftp://cygwin.com/pub/cygwinx/XWin.20100418-git-9594fb420a063608.exe.bz2

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]