LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 02-28-2011, 01:03 PM   #1
Vinter
Member
 
Registered: Feb 2005
Location: Germany
Distribution: Aptosid
Posts: 145

Rep: Reputation: 19
F keys lose functionaity after them switching back from "Multimedia" mode


Hi,

as I recently acquired a minimalistic keyboard with no multimedia keys, I wanted to restore their functionality by replacing the seldomly-used F keys, but still be able to use the F keys when needed.

In order to do that without having to hold down a modifier for either mode, I wrote two simple .Xmodmaps and a shell script to toggle between the two.

.Xmodmap-F:
Code:
keycode 67 = F1
keycode 68 = F2
keycode 69 = F3
keycode 70 = F4
...
.Xmodmap-M:
Code:
keycode 67 = XF86AudioMute
keycode 68 = XF86AudioLowerVolume
keycode 69 = XF86AudioRaiseVolume
keycode 70 = F4
keycode 71 = XF86AudioPlay
...
No further content in there except the continued list of F keys.

Well, starting out with the standard F behavior with F1 as an example, xev tells me:

Code:
KeyPress event, serial 35, synthetic NO, window 0x1800001,
    root 0x15a, subw 0x0, time 353065814, (55,96), root:(735,115),
    state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
There is no difference when executing xmodmap .Xmodmap-F.

If I execute xmodmap .Xmodmap-M, xev says:

Code:
MappingNotify event, serial 59, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 67, count 1
No problems there; F1 now gives:

Code:
KeyPress event, serial 71, synthetic NO, window 0x1800001,
    root 0x15a, subw 0x0, time 353292537, (53,92), root:(733,111),
    state 0x10, keycode 67 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
    XKeysymToKeycode returns keycode: 10
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
Still working, execute xmodmap .Xmodmap-F:

Code:
MappingNotify event, serial 83, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 67, count 1
Seems fine. However, F1 now reads:

Code:
KeymapNotify event, serial 32, synthetic NO, window 0x0,
    keys:  90  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
And even though the focus is grabbed by the xev window, which normally prevents media key usage, the mute function is activated. The message above is _the same_ for any function key formerly defined as a multimedia key - however, F4, which I did not use previously, still reads:

Code:
KeyRelease event, serial 35, synthetic NO, window 0x2000001,
    root 0x15a, subw 0x0, time 356496666, (80,81), root:(760,100),
    state 0x10, keycode 70 (keysym 0xffc1, F4), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
There are three things which make this even stranger:

First, this does not happen every time, but only after toying around with the script I wrote for a while. (Nothing fancy in there, just calls osd_cat to tell me which mode it's now in, writes the current state to disk, and loads the appropriate Xmodmap.)

Second, the keys still work - but only one layer up, i. e. if I press shift+f1 when it should be in multimedia mode, it is there, and the same is true if it should be in function key mode.

Third, and I have not been able to definitely confirm this as the problem doesn't appear all the time, this only seems to happen for the F keys. I. e. if I were to substitute number keys, it would work. (Being impractical, of course, as I need these.)


As soon as this slipup has happened once, there is no way back except restarting X, as reloading a default .Xmodmap or unloading my WMs language module do nothing.

I'm running an up-to-date Aptosid (derived from Debian Unstable) and e17 ecomorph as a WM, with an Enermax Acrylux Wireless (great piece of hardware, btw) keyboard managed by evdev. If you need any more information, I'll be glad to provide it.

Thanks for any advice,
V
 
  


Reply

Tags
aptosid, xmodmap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 05:40 AM
Switching From Daemon to "Regular Mode" surplusxmas Linux - Newbie 4 07-29-2006 11:05 PM
K3b: - Howto re-dock "Directories" and "Contents" windows back into the main window? hagies Linux - Software 4 04-26-2006 09:38 AM
"<" ">" Keyboard keys on Toshiba Satellite 1005-s157 dont work RodCas Linux - Laptop and Netbook 1 05-08-2004 05:22 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM


All times are GMT -5. The time now is 12:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration