LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-28-2004, 01:01 AM   #1
apachedude
Member
 
Registered: Aug 2004
Location: California
Distribution: SuSE 10.0 (SUPER)
Posts: 356

Rep: Reputation: 31
Mapping Multimedia Keyboard - Need more help


I just picked up a Logitech Cordless Internet Pro (should be the samething as Logitech Cordless Desktop Pro) today. I've read several HOWTOs on how to map keys, but they make no sense to me.
I'm running SuSE 9.1 with KDE 3.2. There are two things I'd like to do: 1) map the Win button to pop up the KDE "start menu" and 2) assign the multimedia buttons to work appropriately. The multimedia buttons on my keyboard are media (which I would like execute xmms, Juk, Kaffeine, or the like), play/pause (which obviously resumes or pauses playback from that player), mute (turn off master volume), volume (changes master volume in increments), favorites (I'd leave this blank), email (map to Thunderbird), and www (to Firefox).
So far, all I know how to do is use xev to find the keycode to those buttons. I've also tried making a .Xmodmap script in my home directory. Where do I begin?
 
Old 11-28-2004, 03:47 AM   #2
apachedude
Member
 
Registered: Aug 2004
Location: California
Distribution: SuSE 10.0 (SUPER)
Posts: 356

Original Poster
Rep: Reputation: 31
I did some tinkering by myself using xev. It turned out that Microsoft Natural Keyboard Pro OEM better described the keys. I managed to map favorites, email, and www as I desired. However, how do I tell the master volume (KAmix?) from the command line to adjust the volume? I know from reading other sites that GNOME uses aumix-minimal with various switches. But I have no idea how to run a shell command to lower the volume in KDE.
 
Old 11-28-2004, 04:16 PM   #3
apachedude
Member
 
Registered: Aug 2004
Location: California
Distribution: SuSE 10.0 (SUPER)
Posts: 356

Original Poster
Rep: Reputation: 31
I have almost everything working now, except for the single Win key to pop up the Start Menu. Just in case anyone else wants to know how I did this:
I changed my Logitech's keyboard layout to Microsoft Natural Keyboard Pro OEM, which actually fits the keys better.
I then opened KHotKeys. I mapped www (XF86HomePage) to "firefox", email (XF86Mail) to "thunderbird", favorites (XF86Fav) to "konqueror file:'~'", volume to "amixer set Master 1+" and "1-" respectively, mute to "amixer set Master toggle", and play/pause to "xmms -t". I left media alone for now because I have no reason to use it.

Again, if anyone knows how to map the Win key to pop up the start menu (a single-key shortcut, not a two-key combo), please let me know!

Last edited by apachedude; 11-28-2004 at 04:42 PM.
 
Old 12-06-2004, 04:22 AM   #4
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
One way to map the Win key to open the launch menu involves using xmodmap to define the symbol for it to F13. You can do this in ~/.Xmodmap:

Code:
!~/.Xmodmap
!
keycode 115 = F13
Then you just have to go into Keyboard Shortcuts in Control Center and then define "Popup Launch Menu" to the left Win key. Somehow in Mandrake 10 the Win keys popup the launch menu and the audio multimedia keys use hooks into kmix to change the volume. I looked into the dcop hooks in kamix to and didn't find anything there. Hopefully the developer of kamix will expose dcop hooks to at least allow the master volume level changed using something like khotkeys [edit: it looks like the latest version of kamix might have the required hooks].

Last edited by hazza; 12-06-2004 at 04:45 AM.
 
Old 12-06-2004, 01:32 PM   #5
apachedude
Member
 
Registered: Aug 2004
Location: California
Distribution: SuSE 10.0 (SUPER)
Posts: 356

Original Poster
Rep: Reputation: 31
Hazaa, thanks for the help, but I had tried this previous. What still happens is that I open Keyboard Shortcuts in the KDE menu, and when I press the left Win button (keycode 115), it still flashes "Win+" for a split second, clearly expecting a two-key combo. Then because I let go without pressing a second key, it goes away from the screen.
 
Old 12-06-2004, 04:05 PM   #6
ColBond
Member
 
Registered: Oct 2004
Location: Lawrence, KS
Distribution: Fedora/Gentoo/Debian
Posts: 32

Rep: Reputation: 15
Been following this thread because I've been trying to do a similar thing with my LX700. I'm curios how you can map a button to just a random button combination. Like I want the zoom keys to send Ctrl+ and Ctrl-. and the forward and back to do Alt left and Alt right.

Thanks
Matt W
 
Old 12-06-2004, 09:16 PM   #7
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
Quote:
when I press the left Win button (keycode 115), it still flashes "Win+" for a split second, clearly expecting a two-key combo.
It looks like even though xmodmap is configured to define keycode 115 (Win key) as F13 it is being overriden elsewhere. It might just be that you have to select your keyboard layout in /etc/X11/XF86Config and leave "Enable keyboard layouts" under Keyboard Layout in the Control Center unchecked. This means that you have to find the keyboard section in /etc/X11/XF86Config and set the model in there.

eg

Code:
Section "InputDevice"
  Driver       "Keyboard"
  Identifier   "Keyboard[0]"
  Option       "Protocol" "Standard"
  Option       "XkbLayout" "us"
  Option       "XkbModel" "logidak"
  Option       "XkbRules" "xfree86"
EndSection
You will have to change the XkbModel option to that of your keyboard. The list of model names and keyboard descriptions is in /etc/X11/xkb/rules/xfree86.lst. So mine can be found by doing something like:

Code:
$ grep "Logitech Deluxe Access Keyboard" /etc/X11/xkb/rules/xfree86.lst
  logidak       Logitech Deluxe Access Keyboard
Then restart X and check if the left Win key has been defined as F13 as per ~/.Xmodmap.
 
Old 12-06-2004, 11:19 PM   #8
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
Quote:
Been following this thread because I've been trying to do a similar thing with my LX700. I'm curios how you can map a button to just a random button combination. Like I want the zoom keys to send Ctrl+ and Ctrl-. and the forward and back to do Alt left and Alt right.

Thanks
Matt W
I haven't actually defined any of the multimedia keys to multiple key combinations myself. My suggestion would be first to find out what the keycode the keys you mentioned generate when you press them by using xev.

An extract from the output of xev when I press Messenger multimedia key on my Logitech Access Keyboard is:


KeyRelease event, serial 28, synthetic NO, window 0x3600001,
root 0x38, subw 0x0, time 8852489, (833,-215), root:(838,434),
state 0x0, keycode 236 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes: ""


The part to look for is a keycode that has no symbol assigned to it. You can then use xmodmap to define the keys:

! ~/.Xmodmap
!
keycode xxx = XF86ZoomIn
keycode xxx = XF86ZoomOut
keycode xxx = XF86Back
keycode xxx = XF86Forward

Fill in the the blanks with the keycode that xev shows when you press those keys. You might note in the above post about how loading a keyboard layout in KDE will override any settings made with xmodmap.

Once you have the those keys defined it then becomes a matter of getting defining your application shortkey keys to them. In KDE there's an Application Shortcuts tab under Keyboard Shortcuts. I remember that GNOME had an equivalent place to change the settings. I can't remember if you can define an second alternative for the same action in GNOME though.

It might also be worthwhile creating a keyboard layout for your LX700 (Logitech Cordless Desktop LX700 I presume). I could come up with a template of a patch to add the layout but first I'd need a decent photo of the keyboard in which I can actually see and read the description under each multimedia key.
 
Old 12-07-2004, 11:02 AM   #9
ColBond
Member
 
Registered: Oct 2004
Location: Lawrence, KS
Distribution: Fedora/Gentoo/Debian
Posts: 32

Rep: Reputation: 15
If that's not too much work/trouble, it would be really great. My AIM is ColBondMW, other ways of getting ahold of me are in my profile.
 
Old 12-08-2004, 07:45 PM   #10
maorc
LQ Newbie
 
Registered: Dec 2004
Location: USA
Distribution: Suse 9.2
Posts: 2

Rep: Reputation: 0
xev not responding to multimedia buttons

I use the Microsoft Multimedia Natural Keyboard, and I too try to assign the multimedia buttons to work appropriately.
With xev I can only see some of the buttons responding, and when I switch between different Keyboard Layouts, I get different buttons responding.
How can I make all buttons work?

I am sure that it is worthwhile creating a Keyboard Layout for the this keyboard because it is one of the most popular natural keyboards in the market.

Thanks,
Maor
 
Old 12-09-2004, 04:03 AM   #11
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
Quote:
I use the Microsoft Multimedia Natural Keyboard, and I too try to assign the multimedia buttons to work appropriately.
With xev I can only see some of the buttons responding, and when I switch between different Keyboard Layouts, I get different buttons responding.
How can I make all buttons work?

I am sure that it is worthwhile creating a Keyboard Layout for the this keyboard because it is one of the most popular natural keyboards in the market.

Thanks,
Maor
This is what a patch I created to add one of my keyboards to SUSE 9.1 looks like:
Code:
--- xkb/rules/xfree86.orig	2004-08-23 17:07:00.000000000 +0930
+++ xkb/rules/xfree86	2004-12-09 18:52:35.925979920 +1030
@@ -113,6 +113,7 @@
               rapidaccess rapidaccess2 rapidaccess2a \
               ltcd logiaccess logicdp logicdpa logicink logiciink \
               logiinkse logiinkseusb logiik itouch \
+              logidak \
               mx1998 mx2500 mx2750 \
               microsoftinet microsoftpro microsoftprooem microsoftprose \
               microsoftoffice microsoftmult \
--- xkb/rules/xfree86.lst.orig	2004-04-06 11:38:40.000000000 +0930
+++ xkb/rules/xfree86.lst	2004-10-29 15:21:33.271871456 +0930
@@ -74,6 +74,7 @@
   logiaccess	Logitech Access Keyboard
   logicink	Logitech Internet Navigator Keyboard
   logiciink	Logitech iTouch Internet Navigator Keyboard
+  logidak	Logitech Deluxe Access Keyboard
   logiinkse	Logitech iTouch Internet Navigator Keyboard SE
   logiinkseusb	Logitech iTouch Internet Navigator Keyboard SE (USB)
   logiik	Logitech Internet Keyboard
--- xkb/symbols/inet.orig	2004-04-06 11:38:39.000000000 +0930
+++ xkb/symbols/inet	2004-10-29 15:29:15.649579360 +0930
@@ -1220,6 +1220,15 @@
     key <I16>	{	[ XF86ScrollClick	]	};
 };
 
+partial alphanumeric_keys
+xkb_symbols "logidak" {
+    name[Group1]= "Logitech Deluxe Access Keyboard";
+
+    key <I32>   {       [ XF86WWW               ]       };
+    key <I6C>   {       [ XF86Mail              ]       };
+    key <I65>   {       [ XF86Search            ]       };
+};
+
 partial alphanumeric_keys 
 xkb_symbols "logiinkse" {
     name[Group1]= "Logitech iTouch Internet Navigator Keyboard SE";
--- xkb/symbols.dir.orig	2004-08-23 17:07:35.000000000 +0930
+++ xkb/symbols.dir	2004-10-29 15:16:55.952030480 +0930
@@ -544,6 +544,7 @@
 --p----- a------- inet(logicdpa)
 --p----- a------- inet(logicink)
 --p----- a------- inet(logiciink)
+--p----- a------- inet(logidak)
 --p----- a------- inet(logiinkse)
 --p----- a------- inet(logiinkseusb)
 --p----- a------- inet(logiik)
@@ -739,6 +740,7 @@
 --p----- a------- inet.fixes(logicdpa)
 --p----- a------- inet.fixes(logicink)
 --p----- a------- inet.fixes(logiciink)
+--p----- a------- inet.fixes(logidak)
 --p----- a------- inet.fixes(logiinkse)
 --p----- a------- inet.fixes(logiinkseusb)
 --p----- a------- inet.fixes(logiik)
@@ -959,6 +961,7 @@
 --p----- a------- inet.xkb-cherryblueb(logicdpa)
 --p----- a------- inet.xkb-cherryblueb(logicink)
 --p----- a------- inet.xkb-cherryblueb(logiciink)
+--p----- a------- inet.xkb-cherryblueb(logidak)
 --p----- a------- inet.xkb-cherryblueb(logiinkse)
 --p----- a------- inet.xkb-cherryblueb(logiinkseusb)
 --p----- a------- inet.xkb-cherryblueb(logiik)
That patch is for the Logitech Deluxe Access Keyboard model. From that you can see that the files modified are:
  • /etc/X11/xkb/rules/xfree86 (file name may be xorg)
  • /etc/X11/xkb/rules/xfree86.lst (file name may be xorg.lst)
  • /etc/X11/xkb/symbols/inet
  • /etc/X11/xkb/symbols.dir

Make a backup copy of each of those files by adding a suffix like ".orig" so when you're done you can create a patch by running "gendiff xkb .orig >xkb-keymodel.patch".

You need to pick a one word model name, which was logidak in my case, and add a line with that in the files where I added a line. The main part of mapping the keycodes the multimedia keys to key symtols is in xkb/symbols/inet.


partial alphanumeric_keys
xkb_symbols "logidak" {
name[Group1]= "Logitech Deluxe Access Keyboard";

key <I32> { [ XF86WWW ] };
key <I6C> { [ XF86Mail ] };
key <I65> { [ XF86Search ] };
};


Change your keyboard layout to "Generic 104-key PC" so the multimedia keys will be easier to spot in xev. The multimedia keys you can map to key symbols will show up with keycodes but without key symbols in xev. For example:

KeyRelease event, serial 28, synthetic NO, window 0x3400001,
root 0x38, subw 0x0, time 34880040, (557,384), root:(562,410),
state 0x0, keycode 236 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes: ""


For keycodes above 128 you can convert them to "I" key numbers by subtracting 128 and then converting the answer to hexadecimal:


I_number = keycode - 128
= 236 - 128
= 108 (0x6C)


On my logidak keyboard the key that generated that keycode was the Mail multimedia key so I chose to map it to XF86Mail. I found key symbols that match the multimedia keys by searching through xkb/symbols/inet. When you've finished all the changes make a patch by doing the following in /etc/X11:

Code:
# gendiff xkb .orig
That way next time you upgrade X you can reapply the patch and won't lose the new keyboard layout you've created.

Last edited by hazza; 12-09-2004 at 04:04 AM.
 
Old 12-09-2004, 08:21 PM   #12
maorc
LQ Newbie
 
Registered: Dec 2004
Location: USA
Distribution: Suse 9.2
Posts: 2

Rep: Reputation: 0
Cool. I got half the buttons to work.
The other half do not do respond in xev on the "Generic 104-key PC" layout. Any idea how to identiry those?

Thanks!

PS. When I am done, is there a place that I can submit my patch, so it would be available on the internet, and on the next version of Suse? (and maybe other distributions)
 
Old 12-09-2004, 09:37 PM   #13
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
Quote:
Originally posted by maorc
Cool. I got half the buttons to work.
The other half do not do respond in xev on the "Generic 104-key PC" layout. Any idea how to identiry those?

Thanks!

PS. When I am done, is there a place that I can submit my patch, so it would be available on the internet, and on the next version of Suse? (and maybe other distributions)
My keyboard doesn't have multimedia keys that don't generate key events so I haven't had to deal with that problem yet. That problem does look similar to what's said in Bug 320 - Keymapping for MS natural USB keyboard. My method of mapping the multimedia keys needs keycodes to be reported so you might have to wait until X is patched to report them.

You could submit the patch to add support for the multimedia keys of your keyboard model at freedesktop.org Bugzilla against xorg. With SUSE you could try submitting it through their feedback page.
 
Old 12-22-2004, 09:17 AM   #14
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
I've now noticed that under a 2.6.x version of the kernel I have the same problem of multimedia keys not having keycodes. Whenever one of these keys is pressed the kernel prints a message:

Code:
Dec 23 01:33:55 sonic kernel: Count = 1 Count = 1 Count = 1 Count = 1 Count = 1 Count = 1 <4>atkbd.c: Unknown key pressed (translated set 2, code 0x91 on isa0060/serio0).
Dec 23 01:33:55 sonic kernel: atkbd.c: Use 'setkeycodes e011 <keycode>' to make it known.
Dec 23 01:33:55 sonic kernel: atkbd.c: Unknown key released (translated set 2, code 0x91 on isa0060/serio0).
Dec 23 01:33:55 sonic kernel: atkbd.c: Use 'setkeycodes e011 <keycode>' to make it known.
The message suggests using setkeycodes to map the scancode listed to a keycode but I haven't had any success with it yet.

Last edited by hazza; 12-22-2004 at 09:19 AM.
 
Old 12-24-2004, 02:25 AM   #15
TheVisionary
LQ Newbie
 
Registered: Dec 2004
Location: Canada
Distribution: SuSE
Posts: 7

Rep: Reputation: 0
Hello,

I am also trying to setup a media USB keyboard and found that some keys don't show anything.
Maybe this info can help:
http://www.tcnj.edu/~tolboom2/globlink_rf88.html

Although I have the same keyboard, I am such a newbe I don't even know what to with this :-(
 
  


Reply


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
No keyboard on FC3 or Ubuntu--MS Multimedia Keyboard (PS/2) TravisOSF Linux - Hardware 4 03-04-2008 05:21 PM
Multimedia keyboard tayyab Linux - Hardware 2 08-14-2005 03:54 PM
Multimedia keyboard greenthing SUSE / openSUSE 6 05-09-2005 04:34 PM
Multimedia keyboard. vexer Linux - Hardware 8 05-25-2003 03:15 AM
Multimedia keyboard Goog Linux - Newbie 2 03-18-2003 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:15 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
Open Source Consulting | Domain Registration