LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2005, 09:26 PM   #1
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Rep: Reputation: 45
Help configuring keyboard with X.


I have a Microsoft Digital Media Pro Keyboard. I followed many instructions over a long time trying to get special keys working. I finally figured out how to get some of them going, but have an issue I am lost with.
Stats
OS: SuSE 10.0 OSS 32bit
DE: KDE
Keyboard: Microsoft Digital Media Pro Keyboard
X version: Xorg 6.8
XkbModel: microsoftprooem
xorg.conf:
Code:
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "XkbModel" "microsoftprooem"
Option "XkbRules" "xfree86"
Option "XkbLayout" "us"
Option "XkbCompat" " "
Option "XkbOptions" " "
profile.local:
Code:
xmodmap -e "pointer = 1 2 3 6 7 4 5"
xmodmap -e "keycode 160 = XF86AudioMute"
xmodmap -e "keycode 174 = XF86AudioLowerVolume"
xmodmap -e "keycode 176 = XF86AudioRaiseVolume"
xmodmap -e "keycode 162 = XF86AudioPlay"
xmodmap -e "keycode 164 = XF86AudioStop"
xmodmap -e "keycode 144 = XF86AudioPrev"
xmodmap -e "keycode 153 = XF86AudioNext"
xmodmap -e "keycode 239 = XF86Documents"
xmodmap -e "keycode 236 = XF86Mail"
xmodmap -e "keycode 178 = XF86WWW"
xmodmap -e "keycode 161 = XF86Calculator"
xmodmap -e "keycode 223 = XF86Sleep"
I am using the following list of commands: http://wiki.linuxquestions.org/wiki/...yboard_symbols which is for xfree86, but I don't seem to be able to find one for xorg, so I thought they may be the same. I have 12 extra keys available according to xev, so I made an xmodmap to add these keys with actions. I used actions from a list, which may be outdated and at fault, I don't know for sure. I am trying to map the following keys, and they are mapped, I know for sure, checked with xev, it reports they are indeed sending the signals I mapped.
Code:
Mute: 160 -> XF86AudioMute
Volume Down: 174 -> XF86AudioLowerVolume
Volume Up: 176 -> XF86AudioRaiseVolume
Play/Pause: 162 -> XF86AudioPlay
Stop: 164 -> XF86AudioStop
Back: 144 -> XF86AudioPrev
Forward: 153 - > XF86AudioNext
My Documents: 239 - > XF86Documents
Mail: 236 -> XF86Mail
Web/Home: 178 -> XF86WWW
Calculator: 161 -> XF86Calculator
Sleep: 223 -> XF86Sleep
However, only 3 buttons work: the VolumeUp and VolumeDown and Mute. All other buttons report to xev they are sending the signal, but X and KDE do nothing. Can anyone help me out?
 
Old 11-15-2005, 09:09 AM   #2
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
I have 2 theories:
Does anyone at least know whether it is an issue in outdated bindings, like the XF86____ series is depreciated in XORG? I have looked and looked for keysyms in xorg, but haven't found anything other than the default unicode and so forth.

Or is it something like X doesn't have a defined player, and since system volume can be changed while other stuff isn't whole system, it isn't defined? All of it is defined in KDE, I double checked... so is there a way to let x know what my default home is, and browser, and media player, etc?
 
Old 11-15-2005, 01:51 PM   #3
halvy
Member
 
Registered: Aug 2005
Location: Anchorage, Alaska (soon EU, hopefully)
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 918

Rep: Reputation: 42
i guess you MUST have a reason to have m$ keyboard..

soooo, i'll try not to flame you ;)

first q is , do you realllly have ANY of the keys reprogrammed to work correctly?

i mean, if they are that way anyway, then you need to look at weather the keyboard is possibly defective.

also, try doing what you want with another 'similar' keyboard.

if you have success, then it's a ms keyboard issue, and not x.

lettuce know :)
 
Old 11-15-2005, 07:04 PM   #4
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
Yes, all the buttons work under Windows 2000 and XP. I could try more, but those are the only other drives I have that will boot on that tower, and it isn't worth installing 98 or 95 or 3.1 to test.

And 3 of the buttons work perfectly, the volume up, volume down, and mute buttons work great under SuSE 10.0, however the other 9 I can get to respond to xev do nothing after being assigned commands. There are other buttons(about another 12) that I can't yet get xev to recognize, so they do nothing at all.

I could try a generic keyboard or a logitech keyboard, but that isn't really the point. I know the keyboard works and it is the one I want to use on that tower, as my main tower has the logitech mx3000 with Laser mouse. It is just a matter of getting x to recognize the buttons(which I am 12 of 20some for so far) and then commands to register, then getting the commands towork. That is the part I seem stuck on.
 
Old 11-15-2005, 11:56 PM   #5
halvy
Member
 
Registered: Aug 2005
Location: Anchorage, Alaska (soon EU, hopefully)
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 918

Rep: Reputation: 42
xfree86 and xorg are NOT the same!!

look into switching back to xfree86 (AFTER YOU BACKUP YOUR IMPORTANT DATA) of course :)

i have a feeling that will solve your problem.

either that or get more documentation on how xorg handles this issue.

i have never messed with assigning differnt codes to my keyboard, so i dont' know off the top of my head...

but i would strongly bet there is literature somewhere out there, like you found on wiki concerning the proper way to reassign keys in xorg.

post to let us know how it's going.. :)
 
Old 11-16-2005, 05:34 AM   #6
Correador
LQ Newbie
 
Registered: May 2002
Location: London
Distribution: Mandrake 9
Posts: 7

Rep: Reputation: 0
Please don't go the bother of going back to XFree86, ou are 99% of the way home.

First, the XF86 key symbol database is fine. You know the "xmodmap" opeations have worked if xev shows the right symbols being generated.

Second, I am almost certain that your problem is simply that you have not told KDE what to do now that the new keys are there. By default, KDE does map the volume keys to mixer actions (or maybe to amarok actions -- I can't remember) but you must tell it what you want from the others.

This is done in the Hotkeys part of the KDE Desktop configuration pannel. The simplest option is to map a key to a simple command so XF86WWW runs "konqueror" (or whatever). If you get stuck I can look up the exact details (including DCOP commands to do things like lock the screen saver) because I set that up for someone but I am not at that machine now.
 
Old 11-16-2005, 07:26 AM   #7
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
Don't worry, I had NO plans of reverting back to xfree. in fact in about a month I will be upgrading to xorg7.0 soon as I get back from vacation on the 18th of Dec. Though I will probably clone the drive first, just to make sure when I do, nothing horrible happens.

So in essence, what I can do, is use KDE to assign something like "ctrl+ f7" to "XF86AudioPlay" which I also assign to "Play when using amork"(for example?) in hotkeys? I will take a better look at hotkeys when I get home, but is that basically how it works?

BTW, Later on, I think I will write my whole on xKbModel for my keyboard, but first I want to make sure I can get what is recognized now working.
 
Old 11-16-2005, 07:51 AM   #8
Correador
LQ Newbie
 
Registered: May 2002
Location: London
Distribution: Mandrake 9
Posts: 7

Rep: Reputation: 0
Quote:
So in essence, what I can do, is use KDE to assign something like "ctrl+ f7" to "XF86AudioPlay" which I also assign to "Play when using amork"(for example?) in hotkeys?
Almost. The sequence of conversions from a key combination (ctrl+f7) to a keycode (162) to a key symbol (XF86AudioPlay) is done by the keyboard driver and X11 (including the xmodmap commands). You now need only bind XF86AudioPlay to the action you want. This last bit is done by KDE Hotkeys.

HOWEVER... You may find that KDE programs like amarok "do the right thing" without any further action if you choose the right key symbol in the first place. So, before trying to work out how to get amarok to start/stop playing, try to find out if amarok (or KDE) already understands any particlar key and use xmodmap to map your key codes to the key symbols that KDE understands (you need a KDE expert here -- I am a GNOME).

Running the command "kontact --module kmail" when the key associated with XF86Mail is pressed is simpler. You will need to do that using KDE Hotkeys configuration.

NOTE: On the distro I used (Mandriva 2006) I had to delete the Hotkey examples to get my own to work. Something in the examples was causing problems.
 
Old 11-16-2005, 07:35 PM   #9
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
Okay, well I got
My Documents assigned to /home/redshirt,
Mail is Thunderbird,
Web/Home is FireFox,
Calculator is KCalc,
Sleep is Logout.

That is a start, thanks for the idea there, but rather than using HotKeys, you can actually just use keyboard shortcuts for those, which pops it up right away. So I have 5 more buttons mapped, yay!

However, I still can't figure out how to change the functions of play/pause, stop, back, and forward. I tried using hotkeys and even looked online some, it would appear I have to test for a particular player, then send an action only if it is running. I was hoping for a more general use, like play/pause does a play/pause signal in ANY open media player, or just the active one, and if something is playing it will pause it, if paused, unpause it. Which due to me not wanting to spend hours trying to code... is that possible?

Once I get those, I will see about getting other buttons to be recognized in xev, even if I have to draw my own damn xmodmap or something.

EDIT: After a few minutes, Web/Home, SLEEP, and My DOCS have died, while the other keys still work.

Last edited by RedShirt; 11-16-2005 at 07:40 PM.
 
Old 11-17-2005, 12:37 PM   #10
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
Apparently my edit was too quick, upon restarting x, all buttons currently mapped and assigned in keyboard shortcuts work perfectly. So I am almost home.

Anyone have any idea what kind of script I need to get those play, pause, stop, back, and forward buttons working though?
 
Old 11-17-2005, 03:35 PM   #11
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,645

Rep: Reputation: 146Reputation: 146
Quote:
Originally posted by RedShirt
Anyone have any idea what kind of script I need to get those play, pause, stop, back, and forward buttons working though?
I use a script from http://ffm.junetz.de/members/jh/linux.php4 -- the website is in German, but the script should be fine to read for english speaking people. The script shows how to give commands to xmms or juk, depending on which of the two apps is currrently running.
 
Old 11-17-2005, 08:11 PM   #12
RedShirt
Senior Member
 
Registered: Oct 2005
Location: Denver
Distribution: Sabayon 3.5Loop2
Posts: 1,150

Original Poster
Rep: Reputation: 45
Okay, well I guess that helps, just a matter of adding a few more media players, and finding out what command they should be using to do those actions... So I will have to look into Kaffeine and MPlayer too.
 
  


Reply



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
Logitech wireless keyboard and mouse configuring maelstrom209 SUSE / openSUSE 1 08-19-2005 09:59 PM
usb keyboard and soundcard conflict (sound set to keyboard?) netsurf Linux - Hardware 2 04-09-2005 07:08 AM
re: configuring keyboard to open kmenu w/ ms logo ergo_sum Linux - Newbie 1 11-20-2003 05:18 PM
configuring the keyboard cyn1c Linux - Newbie 1 10-24-2003 10:37 PM
Configuring Keyboard in Wine Baran Linux - Software 0 09-09-2003 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:19 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