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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-26-2006, 05:07 AM
|
#1
|
LQ Newbie
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26
Rep:
|
Microsoft Keyboard Support
I'm a linux newbie and just installed SuSE 10.0 with KDE on my new box.
The problem is, the new comptuer came with a Microsoft keyboard with many buttons that apparently dont work with (SuSE) Linux (KDE).
The buttons include: WinStart (next to Alt), volume up, volume down, mute volume, a zoom in/out slider, My Favourites, Mail, Web/Home, Messenger, Calculator, Log Off and Sleep...
plus Help, Undo, Redo, New, Open, Close, Reply, Fwd, Send, Spell, Save and Print in place of the function keys.
Is it possible to have Linux/SuSE/KDE assign actions to any of these Windows buttons? (particularly Volume, WinStart, and Web/Home)
|
|
|
03-27-2006, 09:21 AM
|
#2
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep:
|
Quote:
Originally Posted by Schalken
I'm a linux newbie and just installed SuSE 10.0 with KDE on my new box.
The problem is, the new comptuer came with a Microsoft keyboard with many buttons that apparently dont work with (SuSE) Linux (KDE).
The buttons include: WinStart (next to Alt), volume up, volume down, mute volume, a zoom in/out slider, My Favourites, Mail, Web/Home, Messenger, Calculator, Log Off and Sleep...
plus Help, Undo, Redo, New, Open, Close, Reply, Fwd, Send, Spell, Save and Print in place of the function keys.
Is it possible to have Linux/SuSE/KDE assign actions to any of these Windows buttons? (particularly Volume, WinStart, and Web/Home)
|
I haven't seen a keyboard with zoom slider but the other keys will work fine.
There are three steps you need to do.
1) See if the keys are recognised by the system.
run the "xev" command and then press the keys you want.
If you don't see anything then the key is not recognised.
If you see something like the following then the key is recognised.
Code:
KeyPress event, serial 27, synthetic NO, window 0x1a00001,
root 0x64, subw 0x0, time 336626296, (185,361), root:(294,428),
state 0x0, keycode 176 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
2) If some keys are not recognised, then it is because the keyboard driver doesn't know these keys exist.
See http://www.linuxquestions.org/questi...38#post2171038 to get them recognised.
3) Now that the keys are recognised you can assign them to the function you want.
For most of the actions you can assign them from KDE.
If you run "kmix" the KDE Mixer it has a menu that you can assign the keys to raise or lower the volume.
The other ones you can assign them from KDE control center i believe.
Also see Keytouch ( http://keytouch.sf.net)
I hope i helped.
|
|
|
03-28-2006, 03:03 AM
|
#3
|
LQ Newbie
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26
Original Poster
Rep:
|
W00t! Calculator, Web/Home and Mail have now been assigned to their keys! However, the volume buttons and the K Menu (Windows) buttons I cannot set.
For the volume buttons, when I attempt to assign them in KMix, nothing shows up in that little button that says the key. And I think I know why:
KeyRelease event, serial 30, synthetic NO, window 0x3600001,
root 0x4b, subw 0x0, time 12421242, (-154,585), root 677,611),
state 0x10, keycode 176 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
Note how it says '0x0, NoSymbol' where it would usually say the name of the key, that must be why I cant assign any acitons to that key. How can I give the VolUp key a 'symbol' (name), so it comes up? (just like in imitheos' example)
And for the Windows button, when I attempt to assign an action to open the K Menu, and I press down the Win button it says 'Win+' and when i realease it it says nothing again, as though it was waiting for me to press another button with it so it says 'Win+K' or something like that. Is there a way that I can make it just have the windows button by itself?
|
|
|
03-28-2006, 03:04 PM
|
#4
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep:
|
Quote:
Originally Posted by Schalken
W00t! Calculator, Web/Home and Mail have now been assigned to their keys! However, the volume buttons and the K Menu (Windows) buttons I cannot set.
For the volume buttons, when I attempt to assign them in KMix, nothing shows up in that little button that says the key. And I think I know why:
KeyRelease event, serial 30, synthetic NO, window 0x3600001,
root 0x4b, subw 0x0, time 12421242, (-154,585), root 677,611),
state 0x10, keycode 176 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
Note how it says '0x0, NoSymbol' where it would usually say the name of the key, that must be why I cant assign any acitons to that key. How can I give the VolUp key a 'symbol' (name), so it comes up? (just like in imitheos' example)
And for the Windows button, when I attempt to assign an action to open the K Menu, and I press down the Win button it says 'Win+' and when i realease it it says nothing again, as though it was waiting for me to press another button with it so it says 'Win+K' or something like that. Is there a way that I can make it just have the windows button by itself?
|
You need to assign a X keysym to the keycode. You can do that by running xmodmap
if you read the XKeysymDB file (usually /etc/X11 or /usr/X11R6/lib/X11 it contains all the X keysyms. You need the
XF86blahblah ones.
Write a file consisting of lines with the following "keycode KEYCODE = XKeysym_you_want"
For example "keycode 176 = XF86AudioRaiseVolume". You need 1 line per keycode.
then you need to load this file with xmodmap. My distribution (Slackware) loads the file /etc/X11/xinit/.Xmodmap
If it doesn't work on yours then you can write the file .Xmodmap in your home directory.
I hope i haven't confused you
Last edited by imitheos; 03-28-2006 at 03:16 PM.
|
|
|
04-08-2006, 10:27 AM
|
#5
|
LQ Newbie
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26
Original Poster
Rep:
|
Beautiful, now the only buttons that dont work are the ones that dont show up in xev. The thread you linked me to says to run 'dmesg' after pressing the misbehaving button, but all i get from that is alot of jumbo in the format ?=?, no mention of the word 'key'. How can I find the 'scancode' of a button that doesn't show up in xev?
|
|
|
04-08-2006, 11:21 AM
|
#6
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep:
|
Quote:
Originally Posted by Schalken
Beautiful, now the only buttons that dont work are the ones that dont show up in xev. The thread you linked me to says to run 'dmesg' after pressing the misbehaving button, but all i get from that is alot of jumbo in the format ?=?, no mention of the word 'key'. How can I find the 'scancode' of a button that doesn't show up in xev?
|
Weird. I have tried in many keyboards and always it worked.
Log in a console (not X) and then try the following:
1) Press the key and then run dmesg and see if the message appears.
If not then
2) run the showkey utility
run "showkey -s" and then press the key.
the output you will will be similar to "0xe0 0x66 0xe0 0xe6"
"0xe6" is the same as "0x66" with the 7th bit on (it means you released it). You don't need that.
You only need "0xe0 0x66". So the syntax of the setkeycodes command will be the following
"setkeycodes e066 keycode". That is whatever you get without the "0x".
Try it and post.
|
|
|
04-11-2006, 08:45 AM
|
#7
|
LQ Newbie
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26
Original Poster
Rep:
|
nothing comes up in showkey (or showkey -s) for the misbehaving keys. Only the keys that come up in xev will come up in showkey (i.e, the ones already configured).
|
|
|
04-12-2006, 03:25 AM
|
#8
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep:
|
Quote:
Originally Posted by Schalken
nothing comes up in showkey (or showkey -s) for the misbehaving keys. Only the keys that come up in xev will come up in showkey (i.e, the ones already configured).
|
Showkey shows keycodes, so it is ok that it doesn't show anything because the keys don't have keycodes.
But, showkey -s show scancodes and it should dump the keys scancodes in the format i mentioned. It can't show nothing. Did you run it
from a tty (virtual console, not X) ?
Neither dmesg nor showkey -s showing anything is very weird.
|
|
|
04-15-2006, 08:42 PM
|
#9
|
LQ Newbie
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26
Original Poster
Rep:
|
I ran it from Konsole. How can I get to this tty/'virtual console' you speak of?
|
|
|
04-16-2006, 02:57 AM
|
#10
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Rep:
|
Quote:
Originally Posted by imitheos
But, showkey -s show scancodes and it should dump the keys scancodes in the format i mentioned. It can't show nothing. Did you run it
from a tty (virtual console, not X) ?
|
I have the same problem with my Microsoft Comfort keyboard. Some of the extra keys (i.e. "Messenger", "Calendar" and "Log off") do not have any keycodes assigned to them.
Running "showkey -s" from a virtual console and hitting any of the above keys will produce an output like this:
Code:
atkbd.c: Unknown key pressed (translated set 2, code 0x95 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e015 <keycode>' to make it known.
atkbd.c: Unknown key released (translated set 2, code 0x95 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e015 <keycode>' to make it known.
I included "sudo setkeycodes 0e15 252" in my ~/.bash_profile, but it does not have any affect inside KDE. Do I need to place this command anywhere specific to be picked up by X?
[EDIT] Nevermind, I should have read the man page more carefully. Looks like I can only use numbers up to 127 for the new keycode. I changed the above line to "setkeycodes e015 124" and placed it in /etc/rc.d/rc.init. It now works perfectly.
The only issue now is that there aren't enough unused keycodes below 127 to cover all the extra keys (such as the five "My Favourites" keys). Well there's nothing we can do about that, is there?
Last edited by daihard; 04-16-2006 at 05:31 AM.
|
|
|
All times are GMT -5. The time now is 05:04 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|