summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2009-09-15 15:20:28 +0200
committerdakkar <dakkar@thenautilus.net>2009-09-15 15:26:42 +0200
commitfbd7bd6081d173ec7fee189db7769d0646c04c84 (patch)
tree07db69c39c5ab22602613577bb211be84f1ebd45
parentdon't show empty tags, show doc count (diff)
downloadthenautilus-fbd7bd6081d173ec7fee189db7769d0646c04c84.tar.gz
thenautilus-fbd7bd6081d173ec7fee189db7769d0646c04c84.tar.bz2
thenautilus-fbd7bd6081d173ec7fee189db7769d0646c04c84.zip
page about the evdev patch
-rw-r--r--src/SW/xf86-input-evdev/document.en.rest.txt58
-rw-r--r--src/SW/xf86-input-evdev/document.it.rest.txt59
l---------src/SW/xf86-input-evdev/du2html.xsl1
3 files changed, 118 insertions, 0 deletions
diff --git a/src/SW/xf86-input-evdev/document.en.rest.txt b/src/SW/xf86-input-evdev/document.en.rest.txt
new file mode 100644
index 0000000..a1ce1be
--- /dev/null
+++ b/src/SW/xf86-input-evdev/document.en.rest.txt
@@ -0,0 +1,58 @@
+=========================================
+ Code-remapping for ``xf86-input-evdev``
+=========================================
+:CreationDate: 2009-09-15 12:49:41
+:Id: SW/xf86-input-evdev
+:tags: - software
+ - keyboard
+
+The standard ``xf86-input-evdev`` driver that comes with `xorg` only
+uses keycodes between 8 and 255, dropping all others. This is fine
+most of the time (who ever saw a keyboard with more than 247 keys on
+it?), but it causes problems when the keycodes generated are not
+compact.
+
+For example, the Apple Aluminum Keyboard (USB ID ``05ac:0221``)
+produces at least one code above 255: the "fn" key is 464. People have
+found other cases, and have `reported them as a bug
+<http://bugs.freedesktop.org/show_bug.cgi?id=11227>`_.
+
+Since I needed my keyboard to work as I want it, I did the only
+sensible thing: I `cloned the repository
+<http://www.thenautilus.net/cgit/xf86-input-evdev/>`_ and patched the
+code.
+
+My patch adds a configuration option, called ``event_key_remap``. Its
+value must be a (whitespace-separated) list of "assignments" of the
+format ``$evdev_code = $x11_code``; the ``$evdev_code`` can be
+obtained with ``showkey -k``, the ``$x11_code`` can be found in
+``/usr/share/X11/xkb/keycodes/evdev`` (or wherever your distribution
+put it).
+
+The implementation is rather simple, creating a look-up table from the
+configuration; the table is not implemented as a simple array, since
+that would have meant taking 64KiB for each device (`evdev` uses 16
+bits for a key event). Instead, I allocate "pages" of 256 bytes, and
+only the pages needed. This way, devices with no remapping use only
+one more pointer in their structures, and devices with very few codes
+to remap use only 256 bytes.
+
+Of course, the configuration can be set either in the ``xorg.conf``
+file, or via `HAL`. My ``/etc/hal/fdi/policy/10-x11-input.fdi`` file
+contains::
+
+ <?xml version="1.0" encoding="utf-8"?>
+ <deviceinfo version="0.2">
+ <match key="info.capabilities" contains="input.keyboard">
+ <append key="input.x11_options.XkbOptions" type="strlist">compose:ralt</append>
+ <append key="input.x11_options.XkbOptions" type="strlist">altwin:meta_win</append>
+ </match>
+ <match key="input.product" string="Apple, Inc Apple Keyboard">
+ <merge key="input.x11_options.XkbLayout" type="string">dakkar</merge>
+ <merge key="input.x11_options.XkbModel" type="string">evdev</merge>
+ <merge key="input.x11_options.XkbVariant" type="string">dvorak-apple-al</merge>
+ <merge key="input.x11_options.event_key_remap" type="string">464=118 120=210 204=211</merge>
+ </match>
+ </deviceinfo>
+
+(Details about my keyboard layout are `elsewhere <../my-layout/>`_.
diff --git a/src/SW/xf86-input-evdev/document.it.rest.txt b/src/SW/xf86-input-evdev/document.it.rest.txt
new file mode 100644
index 0000000..88910a4
--- /dev/null
+++ b/src/SW/xf86-input-evdev/document.it.rest.txt
@@ -0,0 +1,59 @@
+================================================
+ Rimappatura dei codici in ``xf86-input-evdev``
+================================================
+:CreationDate: 2009-09-15 12:49:41
+:Id: SW/xf86-input-evdev
+:tags: - software
+ - keyboard
+
+Il driver ``xf86-input-evdev`` che viene di serie con `xorg` usa
+soltanto i keycode tra 8 e 255, ignorando tutti gli altri. Questo
+funziona per la maggior parte dei casi (chi ha mai visto una tastiera
+con più di 247 tasti?), ma causa problemi quando i keycode con sono
+consecutivi.
+
+Ad esempio, la tastiera Apple Alluminio (ID USB ``05ac:0221``) emette
+qualche codice oltre 255: il tasto "fn" è 464. Altri hanno trovato
+altri casi, e li hanno `segnalati come bug
+<http://bugs.freedesktop.org/show_bug.cgi?id=11227>`_.
+
+Siccome la tastiera mi serve funzionante, e come dico io, ho fatto
+l'unica cosa sensata: ho `clonato il repository
+<http://www.thenautilus.net/cgit/xf86-input-evdev/>`_ e ho modificato
+il codice.
+
+La mia modifica aggiunge un'opzione di configurazione, chiamata
+``event_key_remap``. Il valore deve essere una lista (separata da
+spazi) di "assegnamenti" nella forma ``$evdev_code = $x11_code``; il
+``$evdev_code`` può essere ottenuto con ``showkey -k``, il
+``$x11_code`` può essere trovato nel file
+``/usr/share/X11/xkb/keycodes/evdev`` (o dove la vostra distribuzione
+l'ha messo)
+
+L'implementazione è piuttosto semplice: crea una tabella dalla
+configurazione; la tabella non è implementata come un semplice array,
+visto che in quel caso allocherei 64KiB per device (`evdev` usa 16 bit
+per un evento "tasto"). Invece, alloco "pagine" di 256 byte, e solo le
+pagine che servono. In questo modo, i device senza rimappature
+occupano solo un puntatore in più nelle loro strutture, e i device con
+pochi codici da mappare occupano 256 byte in più.
+
+Ovviamente, la configurazione può essere impostata sia dal file
+``xorg.conf`` sia tramite `HAL`. Il mio file
+``/etc/hal/fdi/policy/10-x11-input.fdi`` contiene::
+
+ <?xml version="1.0" encoding="utf-8"?>
+ <deviceinfo version="0.2">
+ <match key="info.capabilities" contains="input.keyboard">
+ <append key="input.x11_options.XkbOptions" type="strlist">compose:ralt</append>
+ <append key="input.x11_options.XkbOptions" type="strlist">altwin:meta_win</append>
+ </match>
+ <match key="input.product" string="Apple, Inc Apple Keyboard">
+ <merge key="input.x11_options.XkbLayout" type="string">dakkar</merge>
+ <merge key="input.x11_options.XkbModel" type="string">evdev</merge>
+ <merge key="input.x11_options.XkbVariant" type="string">dvorak-apple-al</merge>
+ <merge key="input.x11_options.event_key_remap" type="string">464=118 120=210 204=211</merge>
+ </match>
+ </deviceinfo>
+
+(I dettagli sul mio layout di tastiera stanno `altrove <../my-layout/>`_.
diff --git a/src/SW/xf86-input-evdev/du2html.xsl b/src/SW/xf86-input-evdev/du2html.xsl
new file mode 120000
index 0000000..e2487e0
--- /dev/null
+++ b/src/SW/xf86-input-evdev/du2html.xsl
@@ -0,0 +1 @@
+../../../templates/du2html.xsl \ No newline at end of file