Re: Getting volume keys to work in KDE

2009-03-16 Thread Meir Kriheli
Shachar Shemesh wrote:
 Meir Kriheli wrote:
 

 Better yet, place them in ~/.Xmodmap which is read upon session startup,
   
 Not on Debian, it isn't.
 

Which version of debian (i.e: which version of KDE) ? IIRC it should
work with KDE 4.2.

Even if not, in KDE's autostart script, all you have to do is:

xmodmap ~/.Xmodmap

 I will put in a reference to it in the doc, however. Thanks for the
 feedback.
 
 Shachar
 

Cheers
--
Meir Kriheli

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-14 Thread Shachar Shemesh

Meir Kriheli wrote:



Better yet, place them in ~/.Xmodmap which is read upon session startup,
  

Not on Debian, it isn't.

I will put in a reference to it in the doc, however. Thanks for the 
feedback.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-13 Thread Meir Kriheli
Shachar Shemesh wrote:
 Hi all,
 

snippeded

 Last, we want the KDE startup to make these mappings (which, like I
 said, probably should go into the PC keyboard definition - if anyone has
 the volume keys bound to a different keycode, please shout). Create a
 file called ~/.kde/Autostart/keycodes, which has the following structure:
 
 #!/bin/sh
 xmodmap -e 'keycode 174=XF86AudioLowerVolume'
 xmodmap -e 'keycode 176=XF86AudioRaiseVolume'
 xmodmap -e 'keycode 160=XF86AudioMute'
 xmodmap -e 'keycode 212=XF86MonBrightnessUp'
 xmodmap -e 'keycode 101=XF86MonBrightnessDown'
 
 I'm sure you get the idea from here as far as other undefined keys are
 concerned.
 
 That's it. KDE already has pretty decent default handling of the
 XF86AudioRaiseVolume family of sym codes, so there is nothing further
 you need to do.
 
 Shachar

Better yet, place them in ~/.Xmodmap which is read upon session startup,
that way it's desktop agnostic (same file works for me in KDE, Gnome and
Xfce). here's my .Xmodmap (for Thinkpad X60s):

$ cat ~/.Xmodmap
keycode 234 = XF86Back
keycode 233 = XF86Forward
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 153 = XF86AudioNext
keycode 144 = XF86AudioPrev
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 160 = XF86AudioMute
keycode 159 = XF86LaunchA


Cheers
--
Meir Kriheli

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Getting volume keys to work in KDE

2009-03-12 Thread Shachar Shemesh

Hi all,


I tried to find an answer to this one on the net, and got only things 
that got me in the right direction, but not a complete answer. For the 
sake of documentation, here is how to get KDE to recognize your volume 
keys (or, for that matter, any other special key). The fact that it 
doesn't happen automatically is probably a bug in the keyboard layout 
code. I might file it there. This method works with no special processes 
running. It works whether kmix is running or not. It causes KDE to 
display visual feedback to the fact that the volume is changing.



First order of business is finding out what is the keycode for your 
misfunctioning keys. Run xev. A new window appears, and any message 
sent to that window appears in the console that ran xev. Be careful not 
to move your mouse or press any key other than the ones you want mapped, 
as the messages form very quickly.



Next, with the xev window active, press the keys you want to map. Your 
output should look something like this:




KeyPress event, serial 34, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 61891190, (-690,-222), root:(785,703),
state 0x0, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 61891190, (-690,-222), root:(785,703),
state 0x0, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 61892564, (-690,-222), root:(785,703),
state 0x0, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 61892564, (-690,-222), root:(785,703),
state 0x0, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

This tells me that the key for reducing the monitor's brightness has a 
keycode of 101, and for increasing it of 212. Record the keycodes for 
all keys you are interested in. Also, notice that after the keycode you 
get, in brackets, keysym 0x0, NoSymbol. This indicates that the 
keyboard mapping does not know what this key means. If the key is 
defined, you output should look something like:

KeyRelease event, serial 35, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 62033566, (-65,-284), root:(1410,641),
state 0x0, keycode 176 (keysym 0x1008ff13, XF86AudioRaiseVolume), 
same_screen YES,

XLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x2a1,
root 0x13b, subw 0x0, time 62035609, (-65,-284), root:(1410,641),
state 0x0, keycode 174 (keysym 0x1008ff11, XF86AudioLowerVolume), 
same_screen YES,

XLookupString gives 0 bytes:
XFilterEvent returns: False

This means that I have already implemented what I'm writing about here, 
and keycodes 174 and 176 are already mapped to the Audio down and up 
respectively. If that is what you get, and the symbol indeed matches the 
key's caption, this guide will not help you (but check out a setting 
called global shortcuts in the program that controls the relevant 
operation).


Also, if you press the key and nothing happens, this guide is also 
incapable of helping you. I would recommend switching to the textual 
console and pressing the key. If you get a message from the kernel 
saying that an unknown scan code was received, the situation is still 
salvagable. You can tell the kernel to map the scan code to the right 
keycode. If junk is displayed then the situation may or may not be 
salvagable. It might mean that the kernel misunderstands the scan code, 
but it might also mean (happened to me with a Microsoft PS/2 keyboard 
connected through a PS/2-USB adapter) that something in the hardware 
munges the scan code. If nothing at all happens, it is possible that the 
scan code never reaches the kernel, and then there is very little anyone 
can do.


The next order of business is to tell KDE to make a map between the key 
code and the proper key sym. For that, we need a list of valid key 
symbols. On Debian, you can find this list in /usr/share/X11/XKeysymDB. 
Find there the right symbol for the key. For the audio keys, these are 
XF86AudioLowerVolume (volume down), XF86AudioRaiseVolume (volume up) and 
XF86AudioMute (mute). I'm sure the rest are fairly self explanatory as 
well (well, not all of them. For example, XF86Display is the key that 
switches between monitors - not exactly trivial mapping).


Last, we want the KDE startup to make these mappings (which, like I 
said, probably should go into the PC keyboard definition - if anyone has 
the volume keys bound to a 

Re: Getting volume keys to work in KDE

2009-03-12 Thread Dotan Cohen
2009/3/12 Shachar Shemesh shac...@shemesh.biz:
 Hi all,

 I tried to find an answer to this one on the net, and got only things that
 got me in the right direction, but not a complete answer. For the sake of
 documentation, here is how to get KDE to recognize your volume keys (or, for
 that matter, any other special key). The fact that it doesn't happen
 automatically is probably a bug in the keyboard layout code. I might file it
 there. This method works with no special processes running. It works whether
 kmix is running or not. It causes KDE to display visual feedback to the fact
 that the volume is changing.

 First order of business is finding out what is the keycode for your
 misfunctioning keys. Run xev. A new window appears, and any message sent
 to that window appears in the console that ran xev. Be careful not to move
 your mouse or press any key other than the ones you want mapped, as the
 messages form very quickly.

 Next, with the xev window active, press the keys you want to map. Your
 output should look something like this:

 KeyPress event, serial 34, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 61891190, (-690,-222), root:(785,703),
     state 0x0, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False

 KeyRelease event, serial 34, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 61891190, (-690,-222), root:(785,703),
     state 0x0, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
     XLookupString gives 0 bytes:
     XFilterEvent returns: False

 KeyPress event, serial 34, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 61892564, (-690,-222), root:(785,703),
     state 0x0, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False

 KeyRelease event, serial 34, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 61892564, (-690,-222), root:(785,703),
     state 0x0, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
     XLookupString gives 0 bytes:
     XFilterEvent returns: False

 This tells me that the key for reducing the monitor's brightness has a
 keycode of 101, and for increasing it of 212. Record the keycodes for all
 keys you are interested in. Also, notice that after the keycode you get, in
 brackets, keysym 0x0, NoSymbol. This indicates that the keyboard mapping
 does not know what this key means. If the key is defined, you output should
 look something like:

 KeyRelease event, serial 35, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 62033566, (-65,-284), root:(1410,641),
     state 0x0, keycode 176 (keysym 0x1008ff13, XF86AudioRaiseVolume),
 same_screen YES,
     XLookupString gives 0 bytes:
     XFilterEvent returns: False

 KeyRelease event, serial 35, synthetic NO, window 0x2a1,
     root 0x13b, subw 0x0, time 62035609, (-65,-284), root:(1410,641),
     state 0x0, keycode 174 (keysym 0x1008ff11, XF86AudioLowerVolume),
 same_screen YES,
     XLookupString gives 0 bytes:
     XFilterEvent returns: False

 This means that I have already implemented what I'm writing about here, and
 keycodes 174 and 176 are already mapped to the Audio down and up
 respectively. If that is what you get, and the symbol indeed matches the
 key's caption, this guide will not help you (but check out a setting called
 global shortcuts in the program that controls the relevant operation).

 Also, if you press the key and nothing happens, this guide is also incapable
 of helping you. I would recommend switching to the textual console and
 pressing the key. If you get a message from the kernel saying that an
 unknown scan code was received, the situation is still salvagable. You can
 tell the kernel to map the scan code to the right keycode. If junk is
 displayed then the situation may or may not be salvagable. It might mean
 that the kernel misunderstands the scan code, but it might also mean
 (happened to me with a Microsoft PS/2 keyboard connected through a PS/2-USB
 adapter) that something in the hardware munges the scan code. If nothing at
 all happens, it is possible that the scan code never reaches the kernel, and
 then there is very little anyone can do.

 The next order of business is to tell KDE to make a map between the key code
 and the proper key sym. For that, we need a list of valid key symbols. On
 Debian, you can find this list in /usr/share/X11/XKeysymDB. Find there the
 right symbol for the key. For the audio keys, these are XF86AudioLowerVolume
 (volume down), XF86AudioRaiseVolume (volume up) and XF86AudioMute (mute).
 I'm sure the rest are fairly self explanatory as well (well, not all of
 them. For example, XF86Display is the key that switches between monitors -
 not exactly trivial mapping).

 Last, we want the KDE startup to make these mappings (which, like I said,
 probably should go 

Re: Getting volume keys to work in KDE

2009-03-12 Thread Shachar Shemesh

Dotan Cohen wrote:



Thank you Shachar.

You didn't really need to quote the entire thing just to say that, did you?

 I would like to either post this to the KDE and
Kubuntu lists, or republish it on a webpage so that people can find
it. What say you?

  
Consider it free under the CC-BY-SA license (which is a free license - 
not all CC licenses are).

http://creativecommons.org/licenses/by-sa/2.5/il/

Shachar


--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Dotan Cohen
 You didn't really need to quote the entire thing just to say that, did you?


No, I thought that I was holding Shift when I pagedowned but I wasn't,
so the delete key did nothing. I saw that after I posted already!

  I would like to either post this to the KDE and
 Kubuntu lists, or republish it on a webpage so that people can find
 it. What say you?

 Consider it free under the CC-BY-SA license (which is a free license - not
 all CC licenses are).
 http://creativecommons.org/licenses/by-sa/2.5/il/


I'll put it up on dotancohen.com and send a link to the relevant
lists. I know that many people complain about this. Thanks!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Shachar Shemesh

Dotan Cohen wrote:



I'll put it up on dotancohen.com and send a link to the relevant
lists. I know that many people complain about this. Thanks!

  

You can just point them to the archives for this list:
http://creativecommons.org/licenses/by-sa/2.5/il/

Better still, in a couple of minutes I'll have the article up on the 
Lingnu web site. I would rather you link directly there. This way, I can 
update it should there be any erratas.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Shachar Shemesh

Dotan Cohen wrote:



I'll put it up on dotancohen.com and send a link to the relevant
lists. I know that many people complain about this. Thanks!

  

Please link to http://www.lingnu.com/en/howto/58-kdevolume.html

Thanks,
Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Dotan Cohen
 Please link to http://www.lingnu.com/en/howto/58-kdevolume.html


I just finished publishing it on dotancohen.com but I will remove it
and link to that on the KDE and Kubuntu lists. Thanks, Shachar, it
will help quite a few people.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Shachar Shemesh

Dotan Cohen wrote:


Please link to http://www.lingnu.com/en/howto/58-kdevolume.html




I just finished publishing it on dotancohen.com but I will remove it
and link to that on the KDE and Kubuntu lists. Thanks, Shachar, it
will help quite a few people.

  
Feel free to keep it up if you want (I did release it as CC), but make 
sure you link to the Lingnu copy by way of giving credit.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Dotan Cohen
 Feel free to keep it up if you want (I did release it as CC), but make sure
 you link to the Lingnu copy by way of giving credit.


There is no sense in that. I am aware that some people like to have
all kinds of random information on the 'blogs' to run ads on, but
that's not me. Keeping the info on one page is better for maintenance
(the document will have to be maintained) and won't confuse users who
find two different versions of the same page.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Getting volume keys to work in KDE

2009-03-12 Thread Yuval Hager
  here is how to get KDE to recognize your volume
 keys (or, for that matter, any other special key).

Thanks for the guide! worked perfectly, as advertised. 

--y


signature.asc
Description: This is a digitally signed message part.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il