udev_config.html 11.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.13"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>libinput: Static device configuration via udev</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
<link href="libinputdoxygen.css" rel="stylesheet" type="text/css"/>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="doxy-boot.js"></script>
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">libinput 1.7.0</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="general.html">General setup</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Static device configuration via udev </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>libinput supports some static configuration through udev properties.</p>
<p>These properties are read when the device is initially added to libinput's device list, i.e. before the <a class="el" href="group__base.html#ggac30276a06e8b1434b959f2c8dde74f7ca4da18343b29cc16ae2df09b9a3bff33b">LIBINPUT_EVENT_DEVICE_ADDED</a> event is generated.</p>
<p>The following udev properties are supported: </p><dl>
<dt>LIBINPUT_CALIBRATION_MATRIX </dt>
<dd><p class="startdd">Sets the calibration matrix, see <a class="el" href="group__config.html#ga3d9f1b9be10e804e170c4ea455bd1f1b" title="Return the default calibration matrix for this device. ">libinput_device_config_calibration_get_default_matrix()</a>. If unset, defaults to the identity matrix.</p>
<p>The udev property is parsed as 6 floating point numbers separated by a single space each (scanf(3) format "%f %f %f %f %f %f"). The 6 values represent the first two rows of the calibration matrix as described in <a class="el" href="group__config.html#ga09a798f58cc601edd2797780096e9804" title="Apply the 3x3 transformation matrix to absolute device coordinates. ">libinput_device_config_calibration_set_matrix()</a>.</p>
<p class="enddd">Example values are: </p><div class="fragment"><div class="line">ENV{LIBINPUT_CALIBRATION_MATRIX}=<span class="stringliteral">&quot;1 0 0 0 1 0&quot;</span> # <span class="keywordflow">default</span></div><div class="line">ENV{LIBINPUT_CALIBRATION_MATRIX}=<span class="stringliteral">&quot;0 -1 1 1 0 0&quot;</span> # 90 degree clockwise</div><div class="line">ENV{LIBINPUT_CALIBRATION_MATRIX}=<span class="stringliteral">&quot;-1 0 1 0 -1 1&quot;</span> # 180 degree clockwise</div><div class="line">ENV{LIBINPUT_CALIBRATION_MATRIX}=<span class="stringliteral">&quot;0 1 0 -1 0 1&quot;</span> # 270 degree clockwise</div><div class="line">ENV{LIBINPUT_CALIBRATION_MATRIX}=<span class="stringliteral">&quot;-1 0 1 1 0 0&quot;</span> # reflect along y axis</div></div><!-- fragment -->  </dd>
<dt>LIBINPUT_DEVICE_GROUP </dt>
<dd>A string identifying the <a class="el" href="structlibinput__device__group.html">libinput_device_group</a> for this device. Two devices with the same property value are grouped into the same device group, the value itself is irrelevant otherwise.  </dd>
<dt>ID_SEAT </dt>
<dd>Assigns the physical seat for this device. See <a class="el" href="group__seat.html#gac881036869846ad87eb7814fbf308251" title="Return the physical name of the seat. ">libinput_seat_get_physical_name()</a>. Defaults to "seat0". </dd>
<dt>ID_INPUT </dt>
<dd>If this property is set, the device is considered an input device. Any device with this property missing will be ignored, see <a class="el" href="udev_config.html#udev_device_type">Device type assignment via udev</a>.  </dd>
<dt>ID_INPUT_KEYBOARD, ID_INPUT_KEY, ID_INPUT_MOUSE, ID_INPUT_TOUCHPAD, ID_INPUT_TOUCHSCREEN, ID_INPUT_TABLET, ID_INPUT_JOYSTICK, ID_INPUT_ACCELEROMETER </dt>
<dd>If any of the above is set, libinput initializes the device as the given type, see <a class="el" href="udev_config.html#udev_device_type">Device type assignment via udev</a>. Note that for historical reasons more than one of these may be set at any time, libinput will select only one of these to determine the device type. To ensure libinput selects the correct device type, only set one of them. </dd>
<dt>WL_SEAT </dt>
<dd>Assigns the logical seat for this device. See <a class="el" href="group__seat.html#ga61e477120d5f0cc67a06d04575186948" title="Return the logical name of the seat. ">libinput_seat_get_logical_name()</a> context. Defaults to "default". </dd>
<dt>MOUSE_DPI </dt>
<dd>HW resolution and sampling frequency of a relative pointer device. See <a class="el" href="motion_normalization.html">Normalization of relative motion</a> for details.  </dd>
<dt>MOUSE_WHEEL_CLICK_ANGLE </dt>
<dd>The angle in degrees for each click on a mouse wheel. See libinput_pointer_get_axis_source() for details.  </dd>
<dt>POINTINGSTICK_CONST_ACCEL </dt>
<dd>A constant (linear) acceleration factor to apply to pointingstick deltas to normalize them. </dd>
<dt>LIBINPUT_MODEL_* </dt>
<dd><b>This prefix is reserved as private API, do not use.</b> See <a class="el" href="udev_config.html#model_specific_configuration">Model-specific configuration</a> for details.  </dd>
<dt>LIBINPUT_ATTR_* </dt>
<dd><b>This prefix is reserved as private API, do not use.</b> See <a class="el" href="udev_config.html#model_specific_configuration">Model-specific configuration</a> for details.  </dd>
</dl>
<p>Below is an example udev rule to assign "seat1" to a device from vendor 0x012a with the model ID of 0x034b. </p><div class="fragment"><div class="line">ACTION==<span class="stringliteral">&quot;add|change&quot;</span>, KERNEL==<span class="stringliteral">&quot;event[0-9]*&quot;</span>, ENV{ID_VENDOR_ID}==<span class="stringliteral">&quot;012a&quot;</span>, \</div><div class="line">ENV{ID_MODEL_ID}==<span class="stringliteral">&quot;034b&quot;</span>, ENV{ID_SEAT}=<span class="stringliteral">&quot;seat1&quot;</span></div></div><!-- fragment --><h1><a class="anchor" id="udev_device_type"></a>
Device type assignment via udev</h1>
<p>libinput requires the <b>ID_INPUT</b> property to be set on a device, otherwise the device will be ignored. In addition, one of <b> ID_INPUT_KEYBOARD, ID_INPUT_KEY, ID_INPUT_MOUSE, ID_INPUT_TOUCHPAD, ID_INPUT_TOUCHSCREEN, ID_INPUT_TABLET, ID_INPUT_JOYSTICK, ID_INPUT_ACCELEROMETER</b> must be set on the device to determine the device type. The usual error handling applies within libinput and a device type label does not guarantee that the device is initialized by libinput. If a device fails to meet the requirements for a device type (e.g. a keyboard labelled as touchpad) the device will not be available through libinput.</p>
<p>Only one device type should be set per device at a type, though libinput can handle some combinations for historical reasons.</p>
<p>Below is an example udev rule to remove an <b>ID_INPUT_TOUCHPAD</b> setting and change it into an <b>ID_INPUT_TABLET</b> setting. This rule would apply for a device with the vendor/model ID of 012a/034b.</p>
<div class="fragment"><div class="line">ACTION==<span class="stringliteral">&quot;add|change&quot;</span>, KERNEL==<span class="stringliteral">&quot;event[0-9]*&quot;</span>, ENV{ID_VENDOR_ID}==<span class="stringliteral">&quot;012a&quot;</span>, \</div><div class="line">ENV{ID_MODEL_ID}==<span class="stringliteral">&quot;034b&quot;</span>, ENV{ID_INPUT_TOUCHPAD}=<span class="stringliteral">&quot;&quot;</span>, ENV{ID_INPUT_TABLET}=<span class="stringliteral">&quot;1&quot;</span></div></div><!-- fragment --><h1><a class="anchor" id="model_specific_configuration"></a>
Model-specific configuration</h1>
<p>libinput reserves the property prefixes <b>LIBINPUT_MODEL_</b> and <b>LIBINPUT_ATTR_</b> for model-specific configuration. <b>These prefixes are reserved as private API, do not use.</b></p>
<p>The effect of these properties may be to enable or disable certain features on a specific device or set of devices, to change configuration defaults or any other reason. The effects of setting these properties, the format of the property and the value of the property are subject to change at any time.</p>
<h2><a class="anchor" id="model_specific_configuration_x220fw81"></a>
Lenovo x220 with touchpad firmware v8.1</h2>
<p>The property <b>LIBINPUT_MODEL_LENOVO_X220_TOUCHPAD_FW81</b> may be set by a user in a local hwdb file. This property designates the touchpad on a Lenovo x220 with a touchpad firmware version 8.1. When this firmware version is installed, the touchpad is imprecise. The touchpad device does not send continuos x/y axis position updates, a behavior also observed on its successor model, the Lenovo x230 which has the same firmware version. If the above property is set, libinput adjusts its behavior to better suit this particular model.</p>
<p>The touchpad firmware version cannot be detected automatically by libinput, local configuration is required to set this property. Refer to the libinput model quirks hwdb for instructions.</p>
<p>This property must not be used for any other purpose, no specific behavior is guaranteed. </p>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>