pointer-acceleration.html 12.4 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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
<!-- 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.11"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>libinput: Pointer acceleration</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</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="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
<link href="bootstrap.css" rel="stylesheet" type="text/css"/>
        <link href="bootstrap.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.3.1</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.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="developers.html">Developers</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Pointer acceleration </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>libinput uses device-specific pointer acceleration methods, with the default being the <a class="el" href="pointer-acceleration.html#ptraccel-linear">Linear pointer acceleration</a>.</p>
<p>The methods share common properties, such as <a class="el" href="pointer-acceleration.html#ptraccel-velocity">Velocity calculation</a>.</p>
<p>This page explains the high-level concepts used in the code. It aims to provide an overview for developers and is not necessarily useful for users.</p>
<h1><a class="anchor" id="ptraccel-profiles"></a>
Pointer acceleration profiles</h1>
<p>The profile decides the general method of pointer acceleration. libinput currently supports two profiles: "adaptive" and "flat". The aptive profile is the default profile for all devices and takes the current speed of the device into account when deciding on acceleration. The flat profile is simply a constant factor applied to all device deltas, regardless of the speed of motion (see <a class="el" href="pointer-acceleration.html#ptraccel-profile-flat">The flat pointer acceleration profile</a>). Most of this document describes the adaptive pointer acceleration.</p>
<h1><a class="anchor" id="ptraccel-velocity"></a>
Velocity calculation</h1>
<p>The device's speed of movement is measured across multiple input events through so-called "trackers". Each event prepends a the tracker item, each subsequent tracker contains the delta of that item to the current position, the timestamp of the event that created it and the cardinal direction of the movement at the time. If a device moves into the same direction, the velocity is calculated across multiple trackers. For example, if a device moves steadily for 10 events to the left, the velocity is calculated across all 10 events.</p>
<p>Whenever the movement changes direction or significantly changes speed, the velocity is calculated from the direction/speed change only. For example, if a device moves steadily for 8 events to the left and then 2 events to the right, the velocity is only that of the last 2 events.</p>
<p>An extra time limit prevents events that are too old to factor into the velocity calculation. For example, if a device moves steadily for 5 events to the left, then pauses, then moves again for 5 events to the left, only the last 5 events are used for velocity calculation.</p>
<p>The velocity is then used to calculate the acceleration factor</p>
<h1><a class="anchor" id="ptraccel-factor"></a>
Acceleration factor</h1>
<p>The acceleration factor is the final outcome of the pointer acceleration calculations. It is a unitless factor that is applied to the current delta, a factor of 2 doubles the delta (i.e. speeds up the movement), a factor of less than 1 reduces the delta (i.e. slows the movement).</p>
<p>Any factor less than 1 requires the user to move the device further to move the visible pointer. This is called deceleration and enables high precision target selection through subpixel movements. libinput's current maximum deceleration factor is 0.3 (i.e. slow down to 30% of the pointer speed).</p>
<p>A factor higher than 1 moves the pointer further than the physical device moves. This is acceleration and allows a user to cross the screen quickly but effectively skips pixels. libinput's current maximum acceleration factor is 3.5.</p>
<h1><a class="anchor" id="ptraccel-linear"></a>
Linear pointer acceleration</h1>
<p>The linear pointer acceleration method is the default for most pointer devices. It provides deceleration at very slow movements, a 1:1 mapping for regular movements and a linear increase to the maximum acceleration factor for fast movements.</p>
<p>Linear pointer acceleration applies to devices with above 1000dpi resolution and after <a class="el" href="motion_normalization.html">Normalization of relative motion</a> is applied.</p>
<div class="image">
<img src="ptraccel-linear.svg" alt="ptraccel-linear.svg"/>
<div class="caption">
Linear pointer acceleration</div></div>
<p> The image above shows the linear pointer acceleration settings at various speeds. The line for 0.0 is the default acceleration curve, speed settings above 0.0 accelerate sooner, faster and to a higher maximum acceleration. Speed settings below 0 delay when acceleration kicks in, how soon the maximum acceleration is reached and the maximum acceleration factor.</p>
<p>Extremely low speed settings provide no acceleration and additionally decelerate all movement by a constant factor.</p>
<h1><a class="anchor" id="ptraccel-low-dpi"></a>
Pointer acceleration for low-dpi devices</h1>
<p>Low-dpi devices are those with a physical resolution of less than 1000 dots per inch (dpi). The pointer acceleration is adjusted to provide roughly the same feel for all devices at normal to high speeds. At slow speeds, the pointer acceleration works on device-units rather than normalized coordinates (see <a class="el" href="motion_normalization.html">Normalization of relative motion</a>).</p>
<div class="image">
<img src="ptraccel-low-dpi.svg" alt="ptraccel-low-dpi.svg"/>
<div class="caption">
Pointer acceleration for low-dpi devices</div></div>
<p> The image above shows the default pointer acceleration curve for a speed of 0.0 at different DPI settings. A device with low DPI has the acceleration applied sooner and with a stronger acceleration factor.</p>
<h1><a class="anchor" id="ptraccel-touchpad"></a>
Pointer acceleration on touchpads</h1>
<p>Touchpad pointer acceleration uses the <a class="el" href="pointer-acceleration.html#ptraccel-linear">Linear pointer acceleration</a> profile, with a constant deceleration factor applied. The user expectation of how much a pointer should move in response to finger movement is different to that of a mouse device, hence the constant deceleration factor.</p>
<div class="image">
<img src="ptraccel-touchpad.svg" alt="ptraccel-touchpad.svg"/>
<div class="caption">
Pointer acceleration curve for touchpads</div></div>
<p> The image above shows the touchpad acceleration profile in comparison to the <a class="el" href="pointer-acceleration.html#ptraccel-linear">Linear pointer acceleration</a>. The shape of the curve is identical but vertically squashed.</p>
<h1><a class="anchor" id="ptraccel-trackpoint"></a>
Pointer acceleration on trackpoints</h1>
<p>Trackpoint pointer acceleration uses the <a class="el" href="pointer-acceleration.html#ptraccel-low-dpi">Pointer acceleration for low-dpi devices</a> profile, with a constant deceleration factor taking the place of the DPI settings.</p>
<div class="image">
<img src="ptraccel-trackpoint.svg" alt="ptraccel-trackpoint.svg"/>
<div class="caption">
Pointer acceleration curves for trackpoints</div></div>
<p> The image above shows the trackpoint acceleration profile in comparison to the <a class="el" href="pointer-acceleration.html#ptraccel-linear">Linear pointer acceleration</a>. The constant acceleration factor, usually applied by udev, shapes the acceleration profile.</p>
<h1><a class="anchor" id="ptraccel-profile-flat"></a>
The flat pointer acceleration profile</h1>
<p>In a flat profile, the acceleration factor is constant regardless of the velocity of the pointer and each delta (dx, dy) results in an accelerated delta (dx * factor, dy * factor). This provides 1:1 movement between the device and the pointer on-screen.</p>
<h1><a class="anchor" id="ptraccel-tablet"></a>
Pointer acceleration on tablets</h1>
<p>Pointer acceleration for relative motion on tablet devices is a flat acceleration, with the speed seeting slowing down or speeding up the pointer motion by a constant factor. Tablets do not allow for switchable profiles. </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 on Mon May 30 2016 09:52:15 for libinput by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>