LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-26-2006, 04:07 AM   #1
Schalken
LQ Newbie
 
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26

Rep: Reputation: 15
Lightbulb 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)
 
Old 03-27-2006, 08:21 AM   #2
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 433

Rep: Reputation: 117Reputation: 117
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.
 
Old 03-28-2006, 02:03 AM   #3
Schalken
LQ Newbie
 
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
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), root677,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?
 
Old 03-28-2006, 02:04 PM   #4
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 433

Rep: Reputation: 117Reputation: 117
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), root677,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 02:16 PM.
 
Old 04-08-2006, 09:27 AM   #5
Schalken
LQ Newbie
 
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
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?
 
Old 04-08-2006, 10:21 AM   #6
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 433

Rep: Reputation: 117Reputation: 117
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.
 
Old 04-11-2006, 07:45 AM   #7
Schalken
LQ Newbie
 
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
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).
 
Old 04-12-2006, 02:25 AM   #8
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 433

Rep: Reputation: 117Reputation: 117
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.
 
Old 04-15-2006, 07:42 PM   #9
Schalken
LQ Newbie
 
Registered: Mar 2006
Distribution: Debian/Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
I ran it from Konsole. How can I get to this tty/'virtual console' you speak of?
 
Old 04-16-2006, 01:57 AM   #10
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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 04:31 AM.
 
  


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
Major problems with the keyboard! Microsoft keyboard is not compatable?. aweir14150 Mandriva 2 05-26-2006 06:57 AM
Microsoft keyboard question d1l2w3 Linux - Hardware 5 01-06-2006 12:42 PM
using a microsoft wireless keyboard zapcojake Linux - Hardware 3 02-15-2005 04:19 PM
Microsoft Keyboard...Help me. _UnPrEdictAbLe_ Linux - Hardware 5 08-19-2004 05:29 PM
Microsoft Office Keyboard CRego3D Linux - Hardware 5 01-17-2003 04:59 AM

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

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