Symbian3/SDK/Source/GUID-9AD75103-CD56-5279-B639-5CA2BBF979B5.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-9AD75103-CD56-5279-B639-5CA2BBF979B5" xml:lang="en"><title>Advanced
       
    13 Pointer States and Event Communication</title><shortdesc>The Window Server provides advanced pointer features, such as support
       
    14 for multiple pointers and proximity and pressure coordinates. This topic provides
       
    15 a summary of advanced pointer states and the events that communicate changes
       
    16 of their state. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    17 <p> <b>Variant</b>: <xref href="GUID-D93978BE-11A3-5CE3-B110-1DEAA5AD566C.dita">ScreenPlay</xref>. <b>Target
       
    18 audience</b>: Application developers. </p>
       
    19 <p>This topic builds on the <xref href="GUID-9C269F45-F160-5A4B-ABF8-896D2A538E3B.dita">Advanced
       
    20 Pointer Overview</xref>. </p>
       
    21 <section id="GUID-4B7318D7-29AB-4DE4-B37A-2AFAE055982E"><title>Communication
       
    22 between an input driver and the Window Server</title> <p>The following diagram
       
    23 shows how an input driver communicates changes in pointer state to the Window
       
    24 Server. The diagram shows the logical pointer states and how <xref href="GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD.dita"><apiname>TRawEvent</apiname></xref> types
       
    25 change those states. From the driver's perspective, the pointer can be in
       
    26 one of three basic logical states: <i>Up</i>, <i>Down</i> or <i>OutOfRange</i>. </p> <p>The
       
    27 driver sends a number of types of event to move the pointer between these
       
    28 states. For example, <xref href="GUID-0FD31DF6-3EA2-3EB3-8940-05F187B98B86.dita"><apiname>EButton1Up</apiname></xref> is an <i>Up</i> event that
       
    29 changes the pointer from the <i>Down</i> to the <i>Up</i> state. <xref href="GUID-2786B13B-B95C-3D15-B7D2-205E99A64FBC.dita"><apiname>EButton1Down</apiname></xref> is
       
    30 a <i>Down</i> event. <codeph>EButton1Down</codeph> changes the pointer from
       
    31 the <i>Up</i> to the <i>Down</i> state, and from <i>OutOfRange</i> to the <i>Down</i> state. </p> <p>There
       
    32 can be any number of pointers, and each pointer has a maximum of three buttons.
       
    33 A platform UI is free to implement buttons in any way. However, the Window
       
    34 Server interprets only Button1 as an <b>action</b> and does not interpret
       
    35 the other buttons. </p> <fig id="GUID-2664573F-C5E8-573F-9427-783074351585">
       
    36 <title> Driver communicates pointer state changes to the Window Server   
       
    37         </title>
       
    38 <image href="GUID-35521A99-3F1F-5EE1-8078-FFD8A298C0BD_d0e197572_href.png" placement="inline"/>
       
    39 </fig> <p>For a complete list of pointer states, the events that can be sent
       
    40 by the driver, and the associated events that the Window Server sends to the
       
    41 client, see the <xref href="GUID-9AD75103-CD56-5279-B639-5CA2BBF979B5.dita#GUID-9AD75103-CD56-5279-B639-5CA2BBF979B5/GUID-EC2B9C82-D678-5DFE-89A8-8CFCF5376244">Pointer
       
    42 states and event communication</xref> table below. </p> </section>
       
    43 <section id="GUID-3698CDAC-A904-5C44-BFD1-669D9673D02B"><title> Pointer states</title> <p>Pointing
       
    44 devices can be in one of the following basic states: </p> <table id="GUID-5255E70E-EF7C-5AA6-9F94-AF720B5B805F">
       
    45 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/>
       
    46 <thead>
       
    47 <row>
       
    48 <entry>State</entry>
       
    49 <entry>Description</entry>
       
    50 </row>
       
    51 </thead>
       
    52 <tbody>
       
    53 <row>
       
    54 <entry><p> <b>Out of range</b>  </p> </entry>
       
    55 <entry><p>Not detected by the device's sensors. </p> </entry>
       
    56 </row>
       
    57 <row>
       
    58 <entry><p> <b>Up</b>  </p> </entry>
       
    59 <entry><p>Detected by sensors, coordinates available, not performing an action. </p> </entry>
       
    60 </row>
       
    61 <row>
       
    62 <entry><p> <b>Down</b>  </p> </entry>
       
    63 <entry><p>Detected by sensors, coordinates available, performing an action
       
    64 (as defined above). </p> </entry>
       
    65 </row>
       
    66 </tbody>
       
    67 </tgroup>
       
    68 </table> <p>The following diagram shows the extension of the <i>Up</i> and <i>Down</i> states
       
    69 with additional substates. <i>Up</i> is extended with substates describing
       
    70 the <b>closeness</b> of the pointer to the screen. <i>Down</i> is extended
       
    71 with substates describing <b>pressing</b>. </p> <fig id="GUID-54DA3BEC-A650-5223-8E46-5B68F414A909">
       
    72 <title> Extension of Up and Down states with substates            </title>
       
    73 <image href="GUID-4E1D4E5D-7CE6-5A93-9170-BEF2937FC953_d0e197686_href.png" placement="inline"/>
       
    74 </fig> <p>The Window Server generates the following events for changes of
       
    75 closeness and pressing: </p> <ul>
       
    76 <li id="GUID-72265325-882B-5B38-ABE7-EFDF05758B97"><p> <codeph>EExitCloseProximity</codeph>  </p> </li>
       
    77 <li id="GUID-D22BF039-8D17-53A4-83C1-3390EBDFBE46"><p> <codeph>EEnterCloseProximity</codeph>  </p> </li>
       
    78 <li id="GUID-5968A499-B87B-54D2-9926-EF446ED1BCCD"><p> <codeph>EExitHighPressure</codeph>  </p> </li>
       
    79 <li id="GUID-4FB8633D-29F1-5794-A922-65603035F23A"><p> <codeph>EEnterHighPressure</codeph>  </p> </li>
       
    80 </ul> <p>These are all types of <xref href="GUID-1FFA0073-3D83-388E-A824-08C31F90CC54.dita"><apiname>TPointerEvent</apiname></xref>. Because
       
    81 these state changes depend on the pressure and proximity of the pointer, both
       
    82 of these values are checked each time a new <xref href="GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD.dita"><apiname>TRawEvent</apiname></xref> concerning
       
    83 the pointer arrives from the driver. <xref href="GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD.dita#GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD/GUID-C7FB5C5F-B7E1-3738-B72D-1AD81699414F"><apiname>TRawEvent::EPointer3DOutOfRange</apiname></xref> means
       
    84 that the proximity is infinite and pressure is zero. </p> <p>These events
       
    85 are based on four thresholds: </p> <ul>
       
    86 <li id="GUID-6B27FB3B-EFFE-5D25-B039-FA84F0BFCE66"><p>The <codeph>EExitHighPressure</codeph> threshold
       
    87 (<codeph>EPointer3DExitHighPressureThreshold</codeph> in HAL) </p> <p>This
       
    88 is a threshold on the pointer's Z coordinate. In general, if the pointer crosses
       
    89 this threshold by decreasing pressure (thus decreasing its Z coordinate),
       
    90 the Window Server generates <xref href="GUID-1FFA0073-3D83-388E-A824-08C31F90CC54.dita#GUID-1FFA0073-3D83-388E-A824-08C31F90CC54/GUID-9062D892-DE16-3F74-AC0D-76A7F047B52B"><apiname>TPointerEvent::EExitHighPressure</apiname></xref> and
       
    91 sends it to the client. </p> </li>
       
    92 <li id="GUID-6F8E2E38-59A5-5FF3-B332-5D68252749B9"><p>The <codeph>EEnterHighPressure</codeph> threshold
       
    93 (<codeph>EPointer3DEnterHighPressureThreshold</codeph> in HAL) </p> <p>This
       
    94 is a threshold on the pointer's Z coordinate. In general, if the pointer crosses
       
    95 this threshold by increasing pressure (thus increasing its Z coordinate),
       
    96 the Window Server generates <xref href="GUID-1FFA0073-3D83-388E-A824-08C31F90CC54.dita#GUID-1FFA0073-3D83-388E-A824-08C31F90CC54/GUID-39963088-400D-3F0B-B7B1-36064CE92A67"><apiname>TPointerEvent::EEnterHighPressure</apiname></xref> and
       
    97 sends it to the client. </p> </li>
       
    98 <li id="GUID-CB32D252-B1CD-56D4-A5CF-88E99C2BCDD8"><p>The <codeph>EEnterCloseProximity</codeph> threshold
       
    99 (<codeph>                 EPointer3DEnterCloseProximityThreshold</codeph> in
       
   100 HAL) </p> <p>This is a threshold on the pointer's Z coordinate. In general,
       
   101 if the pointer crosses this threshold by decreasing its proximity from the
       
   102 device (thus increasing its Z coordinate), the Window Server generates <xref href="GUID-1FFA0073-3D83-388E-A824-08C31F90CC54.dita#GUID-1FFA0073-3D83-388E-A824-08C31F90CC54/GUID-7BDBA988-0D3A-35B2-A5AE-FFA56CC48D12"><apiname>TPointerEvent::EEnterCloseProximity</apiname></xref> and
       
   103 sends it to the client. </p> </li>
       
   104 <li id="GUID-C60E937A-E786-55CE-BEEC-655E78B6ED41"><p>The <codeph>EExitCloseProximity</codeph> threshold
       
   105 (<codeph>EPointer3DExitCloseProximityThreshold</codeph> in HAL) </p> <p>This
       
   106 is a threshold on the pointer's Z coordinate. In general, if the pointer crosses
       
   107 this threshold by increasing its proximity from the device (thus decreasing
       
   108 its Z coordinate), the Window Server generates <xref href="GUID-1FFA0073-3D83-388E-A824-08C31F90CC54.dita#GUID-1FFA0073-3D83-388E-A824-08C31F90CC54/GUID-C9226074-F285-3934-83C1-5533485FE6A6"><apiname>TPointerEvent::EExitCloseProximity</apiname></xref> and
       
   109 sends it to the client. </p> </li>
       
   110 </ul> <p>Applications can configure these thresholds at runtime by using Window
       
   111 Server APIs in <xref href="GUID-643DDA78-C7A7-386D-AB3F-8710141DDDA9.dita"><apiname>RWsSession</apiname></xref>. All applications can read these
       
   112 thresholds. However, only code with <codeph>WriteDeviceData</codeph> capability
       
   113 can change them because these changes should be made only by the device's
       
   114 configuration application. </p> </section>
       
   115 <section id="GUID-EC2B9C82-D678-5DFE-89A8-8CFCF5376244"><title>Pointer states
       
   116 and event communication</title> <p>The table below shows all possible pointer
       
   117 states. For each state it shows all of the events that can be sent by the
       
   118 driver and all of the events that are sent by the Window Server to the client.
       
   119 The end state of the pointer is also shown. There are five pointer zones (states)
       
   120 and four thresholds. An event is generated when the pointer's z position crosses
       
   121 a threshold. </p> <table id="GUID-630982B7-0367-558B-A1B0-B115EB7625A9">
       
   122 <tgroup cols="4"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/><colspec colname="col3"/>
       
   123 <thead>
       
   124 <row>
       
   125 <entry> Pointer state</entry>
       
   126 <entry>  <codeph>TRawEvent</codeph> received from driver</entry>
       
   127 <entry>  <codeph>TPointerEvent</codeph> sent by Window Server</entry>
       
   128 <entry>Resulting pointer state</entry>
       
   129 </row>
       
   130 </thead>
       
   131 <tbody>
       
   132 <row>
       
   133 <entry><p>OutOfRange </p> </entry>
       
   134 <entry><p> <codeph>EPointer3DOutOfRange</codeph>  </p> </entry>
       
   135 <entry><p>— </p> </entry>
       
   136 <entry><p> <codeph>EOutOfRange</codeph>  </p> </entry>
       
   137 </row>
       
   138 <row>
       
   139 <entry><p>OutOfRange </p> </entry>
       
   140 <entry><p> <codeph>EMove</codeph> (Z &lt; <codeph>EEnterCloseProximity</codeph> threshold) </p> </entry>
       
   141 <entry><p> <codeph>EMove</codeph>  </p> </entry>
       
   142 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   143 </row>
       
   144 <row>
       
   145 <entry><p>OutOfRange </p> </entry>
       
   146 <entry><p> <codeph> EMove</codeph> (Z &gt;= <codeph>EEnterCloseProximity</codeph> threshold) </p> </entry>
       
   147 <entry><p> <codeph>EEnterCloseProximity</codeph>  </p> </entry>
       
   148 <entry><p>Up/InCloseProximity </p> </entry>
       
   149 </row>
       
   150 <row>
       
   151 <entry><p>OutOfRange </p> </entry>
       
   152 <entry><p> <codeph>EButton1Down</codeph> (Z &lt; <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   153 <entry><p> <codeph>EButton1Down</codeph>  </p> </entry>
       
   154 <entry><p>Down/NotPressing </p> </entry>
       
   155 </row>
       
   156 <row>
       
   157 <entry><p>OutOfRange </p> </entry>
       
   158 <entry><p> <codeph> EButton1Down</codeph> (Z &gt;= <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   159 <entry><p> <codeph>EButton1Down</codeph>, <codeph>EEnterHighPressure</codeph>  </p> </entry>
       
   160 <entry><p>Down/Pressing </p> </entry>
       
   161 </row>
       
   162 <row>
       
   163 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   164 <entry><p> <codeph>EPointer3DOutOfRange</codeph>  </p> </entry>
       
   165 <entry><p> <codeph>EOutOfRange</codeph>  </p> </entry>
       
   166 <entry><p>OutOfRange </p> </entry>
       
   167 </row>
       
   168 <row>
       
   169 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   170 <entry><p> <codeph>EMove</codeph> (Z &lt; <codeph>EEnterCloseProximity</codeph> threshold) </p> </entry>
       
   171 <entry><p> <codeph>EMove</codeph>  </p> </entry>
       
   172 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   173 </row>
       
   174 <row>
       
   175 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   176 <entry><p> <codeph>EMove</codeph> (Z &gt;= <codeph>EEnterCloseProximity</codeph> threshold) </p> </entry>
       
   177 <entry><p> <codeph>EEnterCloseProximity</codeph>  </p> </entry>
       
   178 <entry><p>Up/InCloseProximity </p> </entry>
       
   179 </row>
       
   180 <row>
       
   181 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   182 <entry><p> <codeph>EButton1Down</codeph> (Z &lt; <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   183 <entry><p> <codeph>EButton1Down</codeph>  </p> </entry>
       
   184 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   185 </row>
       
   186 <row>
       
   187 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   188 <entry><p> <codeph>EButton1Down</codeph> (Z &gt;= <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   189 <entry><p> <codeph>EButton1Down</codeph>, <codeph>EEnterHighPressure</codeph>  </p> </entry>
       
   190 <entry><p>Down/InHighPressure </p> </entry>
       
   191 </row>
       
   192 <row>
       
   193 <entry><p>Up/InCloseProximity </p> </entry>
       
   194 <entry><p> <codeph>EPointer3DOutOfRange</codeph>  </p> </entry>
       
   195 <entry><p> <codeph>EOutOfRange</codeph>  </p> </entry>
       
   196 <entry><p>OutOfRange </p> </entry>
       
   197 </row>
       
   198 <row>
       
   199 <entry><p>Up/InCloseProximity </p> </entry>
       
   200 <entry><p> <codeph>EMove</codeph> (Z &lt; <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   201 <entry><p> <codeph>EExitCloseProximity</codeph>  </p> </entry>
       
   202 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   203 </row>
       
   204 <row>
       
   205 <entry><p>Up/InCloseProximity </p> </entry>
       
   206 <entry><p> <codeph>EMove</codeph> (Z &gt;= <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   207 <entry><p> <codeph>EMove</codeph>  </p> </entry>
       
   208 <entry><p>Up/InCloseProximity </p> </entry>
       
   209 </row>
       
   210 <row>
       
   211 <entry><p>Up/InCloseProximity </p> </entry>
       
   212 <entry><p> <codeph>EButton1Down</codeph> (Z &lt; <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   213 <entry><p> <codeph>EButton1Down</codeph>  </p> </entry>
       
   214 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   215 </row>
       
   216 <row>
       
   217 <entry><p>Up/InCloseProximity </p> </entry>
       
   218 <entry><p> <codeph>EButton1Down</codeph> (Z &gt;= <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   219 <entry><p> <codeph>EButton1Down</codeph>, <codeph>EEnterHighPressure</codeph>  </p> </entry>
       
   220 <entry><p>Down/InHighPressure </p> </entry>
       
   221 </row>
       
   222 <row>
       
   223 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   224 <entry><p> <codeph>EButton1Up</codeph> (Z &lt; <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   225 <entry><p> <codeph>EButton1Up</codeph>, <codeph>EExitCloseProximity</codeph>  </p> </entry>
       
   226 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   227 </row>
       
   228 <row>
       
   229 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   230 <entry><p> <codeph>EButton1Up</codeph> (Z &gt;= <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   231 <entry><p> <codeph>EButton1Up</codeph>  </p> </entry>
       
   232 <entry><p>Up/InCloseProximity </p> </entry>
       
   233 </row>
       
   234 <row>
       
   235 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   236 <entry><p> <codeph>EMove</codeph> (Z &lt; <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   237 <entry><p> <codeph>EDrag</codeph>  </p> </entry>
       
   238 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   239 </row>
       
   240 <row>
       
   241 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   242 <entry><p> <codeph>EMove</codeph> (Z &gt;= <codeph>EEnterHighPressure</codeph> threshold) </p> </entry>
       
   243 <entry><p> <codeph>EEnterHighPressure</codeph>  </p> </entry>
       
   244 <entry><p>Down/InHighPressure </p> </entry>
       
   245 </row>
       
   246 <row>
       
   247 <entry><p>Down/InHighPressure </p> </entry>
       
   248 <entry><p> <codeph>EButton1Up</codeph> (Z &lt; <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   249 <entry><p> <codeph>EButton1Up</codeph>, <codeph>EExitCloseProximity</codeph>  </p> </entry>
       
   250 <entry><p>Up/OutOfCloseProximity </p> </entry>
       
   251 </row>
       
   252 <row>
       
   253 <entry><p>Down/InHighPressure </p> </entry>
       
   254 <entry><p> <codeph>EButton1Up</codeph> (Z &gt;= <codeph>EExitCloseProximity</codeph> threshold) </p> </entry>
       
   255 <entry><p> <codeph>EButton1Up</codeph>  </p> </entry>
       
   256 <entry><p>Up/InCloseProximity </p> </entry>
       
   257 </row>
       
   258 <row>
       
   259 <entry><p>Down/InHighPressure </p> </entry>
       
   260 <entry><p> <codeph>EMove</codeph> (Z &lt; <codeph>EExitHighPressure</codeph> threshold) </p> </entry>
       
   261 <entry><p> <codeph>EExitHighPressure</codeph>  </p> </entry>
       
   262 <entry><p>Down/OutOfHighPressure </p> </entry>
       
   263 </row>
       
   264 <row>
       
   265 <entry><p>Down/InHighPressure </p> </entry>
       
   266 <entry><p> <codeph>EMove</codeph> (Z &gt;= <codeph>EExitHighPressure</codeph> threshold) </p> </entry>
       
   267 <entry><p> <codeph>EDrag</codeph>  </p> </entry>
       
   268 <entry><p>Down/InHighPressure </p> </entry>
       
   269 </row>
       
   270 </tbody>
       
   271 </tgroup>
       
   272 </table> <p>The driver is prohibited from sending <codeph>EPointer3DOutOfRange</codeph> when
       
   273 the pointer is in the Down state. Therefore this is not included in this table.
       
   274 Because <codeph>TRawEvent</codeph>'s <codeph>EPointer3DOutOfRange</codeph> events
       
   275 do not have coordinates, the Window Server makes sure the event is delivered
       
   276 to the place where the previous event for the same pointer occurred. It does
       
   277 this by maintaining the last state of the pointer. </p> <p>The following diagram
       
   278 shows the events sent from the Window Server to the client while
       
   279 the pointer traverses the full cycle of events—from OutOfRange, through Down/InHighPressure
       
   280 and back to OutOfRange. This diagram does not show all of the possible state
       
   281 transitions that are described in the table above. </p> <fig id="GUID-C39B447C-0908-5F9A-95EC-2F97E56E2C20">
       
   282 <title> Events sent from Window Server to client while the pointer traverses
       
   283 the full cycle of states.            </title>
       
   284 <image href="GUID-8F4C626F-3490-50BC-A97F-FD1972FFF65B_d0e198639_href.png" placement="inline"/>
       
   285 </fig> </section>
       
   286 </conbody><related-links>
       
   287 <link href="GUID-9C269F45-F160-5A4B-ABF8-896D2A538E3B.dita"><linktext>Advanced
       
   288 Pointer Overview</linktext></link>
       
   289 <link href="GUID-C60DC070-572B-5960-B394-550426FDB909.dita"><linktext>Advanced
       
   290 Pointer Tutorial</linktext></link>
       
   291 </related-links></concept>