[PATCH 1/2] Input: Add input.xkb properties

Daniel Stone daniel at fooishbar.org
Tue Aug 7 15:46:50 PDT 2007


Add input.xkb.{rules,model,layout,variant,options} to the spec and add a
default implementation, which specifies a keyboard ruleset to use for
XKB.
---
 doc/spec/hal-spec-properties.xml    |   76 +++++++++++++++++++++++++++++++++++
 fdi/policy/10osvendor/10-keymap.fdi |   16 +++++++-
 2 files changed, 91 insertions(+), 1 deletions(-)

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 94bc171..b360374 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -4740,6 +4740,82 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
         </tgroup>
       </informaltable>
     </sect2>
+    <sect2 id="device-properties-input-xkb">
+      <title>
+        input.xkb namespace
+      </title>
+      <para>
+        Device objects with the capability <literal>input.keys</literal>
+        can provide information about their physical layout.
+      </para>
+      <informaltable>
+        <tgroup cols="2">
+          <thead>
+            <row>
+              <entry>Key (type)</entry>
+              <entry>Values</entry>
+              <entry>Mandatory</entry>
+              <entry>Description</entry>
+            </row>
+          </thead>
+          <tbody>
+            <row>
+              <entry>
+                <literal>input.xkb.rules</literal> (string)
+              </entry>
+              <entry>e.g. "base"</entry>
+              <entry>Yes</entry>
+              <entry>
+                XKB rules file to use; 'base' is standard, but 'xorg'
+                or 'xfree86' may be needed for backwards compatibility
+                with very old versions of XKB data.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>input.xkb.model</literal> (string)
+              </entry>
+              <entry>e.g. "logicdp"</entry>
+              <entry>Yes</entry>
+              <entry>
+                Physical keyboard model (e.g. Logitech Cordless Freedom
+                Pro), as given to XKB.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>input.xkb.layout</literal> (string)
+              </entry>
+              <entry>e.g. "us"</entry>
+              <entry>Yes</entry>
+              <entry>
+                Keyboard layout (as engraved on the keys).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>input.xkb.variant</literal> (string)
+              </entry>
+              <entry>e.g. "nodeadkeys"</entry>
+              <entry>No</entry>
+              <entry>
+                Variant of the XKB layout (if any) to use.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>input.xkb.options</literal> (strlist)
+              </entry>
+              <entry>e.g. "ctrl:nocaps"</entry>
+              <entry>No</entry>
+              <entry>
+                Options to be provided to XKB.
+              </entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </informaltable>
+    </sect2>
     <sect2 id="device-properties-pcmcia_socket">
       <title>
         pcmcia_socket namespace
diff --git a/fdi/policy/10osvendor/10-keymap.fdi b/fdi/policy/10osvendor/10-keymap.fdi
index 9b92b1b..c9ad87c 100644
--- a/fdi/policy/10osvendor/10-keymap.fdi
+++ b/fdi/policy/10osvendor/10-keymap.fdi
@@ -4,6 +4,20 @@
     <match key="info.capabilities" contains="input.keymap">
       <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
     </match>
+
+    <match key="info.capabilities" contains="input.keys">
+      <merge key="input.xkb.rules" type="string">base</merge>
+
+      <!-- If we're using Linux, we use evdev by default (falling back to
+           keyboard otherwise). -->
+      <merge key="input.xkb.model" type="string">keyboard</merge>
+      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+             string="Linux">
+        <merge key="input.xkb.model" type="string">evdev</merge>
+      </match>
+
+      <merge key="input.xkb.layout" type="string">us</merge>
+      <merge key="input.xkb.variant" type="string" />
+    </match>
   </device>
 </deviceinfo>
-
-- 
1.4.4.2



More information about the hal mailing list