Talk:How to get special keys to work

From ThinkWiki
Revision as of 22:52, 6 February 2006 by Wyrfel (Talk | contribs) (Bind Fn to super or hyper)
Jump to: navigation, search

The xmodmap step doesn't seem to work when using the "kdb" driver of xorg. Here are the changes I needed to make to my setup to get the "back" and "forward" keys to work (in diff -u format);

--- xkb/symbols/inet.oud        2004-12-01 08:36:04.000000000 +0100
+++ xkb/symbols/inet    2005-03-08 19:59:32.587636120 +0100
@@ -1875,6 +1875,16 @@
     key <I76>  {       [ XF86AudioLowerVolume  ]       };
 };
 
+// IBM ThinkPad 41 Internet Keys
+
+partial alphanumeric_keys
+xkb_symbols "tp41" {
+    name[Group1]= "IBM ThinkPad 41 Internet Keys";
+
+    key <I69>  {       [ F22           ]       };
+    key <I6A>  {       [ F21           ]       };
+};
+
 // Trust
 
 partial alphanumeric_keys
--- xkb/rules/xorg.lst.oud      2004-12-01 08:36:05.000000000 +0100
+++ xkb/rules/xorg.lst  2005-03-07 20:55:21.000000000 +0100
@@ -97,6 +97,7 @@
   sven         SVEN Ergonomic 2500
   symplon      Symplon PaceBook (tablet PC)
   toshiba_s3000        Toshiba Satellite S3000
+  tp41         IBM ThinkPad 41 Internet Keys
   trust                Trust Wireless Keyboard Classic
   trustda      Trust Direct Access Keyboard
   yahoo                Yahoo! Internet Keyboard
--- xkb/rules/xorg.oud  2004-12-01 08:36:05.000000000 +0100
+++ xkb/rules/xorg      2005-03-07 20:45:59.000000000 +0100
@@ -120,7 +120,7 @@
               qtronix \
               samsung4500 samsung4510 \
               sk1300 sk2500 sk6200 sk7100 \
-              sven symplon toshiba_s3000 trust trustda yahoo
+              sven symplon toshiba_s3000 tp41 trust trustda yahoo

 ! model         =       symbols
   $inetkbds     =       +inet(%m)
--- xkb/rules/xorg.xml.oud      2004-12-01 08:36:05.000000000 +0100
+++ xkb/rules/xorg.xml  2005-03-07 20:52:35.000000000 +0100
@@ -975,6 +975,13 @@
     </model>
     <model>
       <configItem>
+        <name>tp41</name>
+        <description>IBM Thinkpad 41 Internet Keys</description>
+        <description xml:lang="nl">IBM ThinkPad 41 internet toetsen</description>
+      </configItem>
+    </model>
+    <model>
+      <configItem>
         <name>trust</name>
         <description>Trust Wireless Keyboard Classic</description>
         <description xml:lang="fr">clavier classique Trust Wireless</description> 

Do not forget to add something like "+inet(tp41)" to /etc/X11/xorg.conf:

       (...)
       Option      "XkbLayout" "us_intl+inet(tp41)"
       (...)

Not T41 specific

These keys are hardly T41 specific, they can also be found on the T30, T40, T42 and I'm sure several other ThinkPads in the X, R and G lineup.

Actually, the above patches could be completed with the information of the other special keys found on some Thinkpads (which is listed in How_to_get_special_keys_to_work#xmodmap_configuration) and submitted as a request for enhancement with xorg's bugzilla. However, firefox doesn't yet recognize keysyms like XF86Back, XF86Forward, so then firefox still needs to be patched manually (unless an enhancement is requested for firefox too).

Fake ACPI events?

Not all keys generate ACPI events. Maybe it is feasible to have the ibm-acpi module check the CMOS (instead of having tpb checking /dev/nvram) and generate fake ACPI events for those keys. Even if it is feasible, that is probably way to hacky for a kernel module ... Still, it would be nice to only have to use scripts triggered by ACPI events and not both scripts for ACPI events and scripts for tpb.


I think something like this is possible with ibm-acpi 0.10 already. It provides a proc file from which you can derive a table of CMOS states. You'd only have to figure the who is who of CMOS bits and write a daemon (or daemon like shell script) checking them regularly. This should be about what you suggest since tpb does the same thing with the bios ram. Of course generating ACPI events can not be done like that (or can it?), but you could trigger the ACPI action scripts directly then.

Wyrfel 01:02, 14 Mar 2005 (CET)


It may be possible (I have a 770x, so don't have the special keys) to add the keys as real ACPI events, by altering the DSDT. I've done this to enable ACPI events for Fn-(every labelled F key),Home,End,PgUp,PgDn on mine, and they aren't labelled with anything physically (no thinklight and physical brightness control). The Embedded Controller reports all events, including keys, by calling one of the _Qxx functions (you'll find a whole pile in the sourcecode for the DSDT). If you then insert a fucntion in the same scope as the others like:-

Method (_Q12, 0, NotSerialized) { \_SB.HKEY.MHKQ (0x1003) } //Fn-F3

when executed, ibm-acpi will then report an acpi event numbered 0x0001003. You should find some functions, e.g. _Q1B For Fn-F12 identical to this.

I found some IBM DSDT's had functions that made MKHQ calls for EC functions _Q63, _Q64, _Q4E, _Q4F, but did nothing on mine---maybe these are a good starting point. Add a whole pile, and see if you get lucky! (At your own risk, of course... :/ But it should be pretty safe).

Yes, the above sounds pretty identical to tpb, except with /proc/ibm/ecdump instead of /dev/nvram. The above works very nicely, however there's luck involved in finding the right number, even if it exists!

lentinj


Fn+F6 does not seem to generate an event on t41p even if the mask is set to 0xffff and experimental=1 is passed to ibm_acpi tf


Bind Fn to super or hyper

Hello

Is it possible to bind Fn via Xmodmap to a key modifier such as hyper or super? Thanks Oub 13:14, 6 February 2006 (CET):


I doubt it. The event for the Fn key is generated at release (as opposed to holding it where it serves it's usual special function). Hence you can't use it as a modifier. Wyrfel 22:52, 6 February 2006 (CET)