Re: Xinput: units of the coordinates in motion-events?
Uli Schlachter <[email protected]> Thu, 25 Oct 2018 18:12:33 +0200
| Newsgroups | gmane.comp.freedesktop.xcb |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 25.10.2018 17:28, Christophe Lohr wrote: > Simply speaking, how to convert a FP1616 into a float? > (I just have to do FP1616 / 2^16 )? ...yes. Is there any problem with just doing that? See e.g. https://en.wikipedia.org/wiki/Fixed-point_arithmetic on fixed point numbers. In xinput.h, xcb_input_fp1616_t is a typedef for int32_t. So, you can do the conversion e.g. via: float f = wire_value / 65536.0 Since the code that you sent already does this: What is your actual problem? Cheers, Uli -- "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. _______________________________________________ Xcb mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/xcb