<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
I'm trying to use xinput to get pointer position (see attached
code)<br>
<br>
I h'ave a question about the type used to return coordinates. How to
convert this xcb_input_fp1616_t into a float?<br>
<br>
According to specification
(<a class="moz-txt-link-freetext" href="https://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.txt">https://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.txt</a>):<br>
<pre> FP1616
Fixed point decimal in 16.16 format as one INT16 and one CARD16.
The INT16 contains the integral part, the CARD16 the decimal fraction
shifted by 16.</pre>
<br>
So, ok the higher 16bits is the coordinate in terms of pixels on the
window (a signed 16bits integer)<br>
<br>
But what's about the lower 16bits (an unsigned 16 bits interger)?<br>
This supposes to count fractions. But fractions of what? Of
portions of 1 / 2^16 pixel ?<br>
Shifted by 16... but 16 bits? to the left? right? to do what?<br>
<br>
Simply speaking, how to convert a FP1616 into a float?<br>
(I just have to do FP1616 / 2^16 )?<br>
<br>
Many thanks<br>
Regards<br>
</body>
</html>