tag:blogger.com,1999:blog-6112936277054198647.post8060802352152647757..comments2024-03-12T00:42:06.642+10:00Comments on Who-T: Understanding evdevPeter Huttererhttp://www.blogger.com/profile/17204066043271384535noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-6112936277054198647.post-433895835212273232019-01-11T19:36:49.070+10:002019-01-11T19:36:49.070+10:00
Hi,
I set some calibration/settings on ...<br /><br /> Hi,<br /><br /> I set some calibration/settings on input device (turn device wheel to left. I did this with write() function) while this happens input system gathers data. So when I first call libevdev_next_event it gives me old garbage data. But I dont want those.<br /><br /> How can I flush/clear buffered data with libevdev? Is there any way?<br /><br /> (Execuse me for my english I am not native)<br /><br /> Yours Sincerely..<br />Anonymoushttps://www.blogger.com/profile/17660264942485899240noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-33324922937468096732017-03-17T07:50:35.592+10:002017-03-17T07:50:35.592+10:00Yagamy: the js1 devices are joydev devices and don...Yagamy: the js1 devices are joydev devices and don't speak the evdev protocol, it's a different kernel driver (similar to evdev0 vs mouse0 - same physical device but different device nodes with different protocols).<br /><br />The kernel knows the button mappings for some devices, primarily where there's a custom driver. otherwise it relies on HID mappings (+quirks) or guessworkPeter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-30796292214724292682017-03-16T20:00:43.952+10:002017-03-16T20:00:43.952+10:00FTR as the next question I am curious about is &qu...FTR as the next question I am curious about is "doesn't libinput handle gamepads?", the answer is here https://lists.freedesktop.org/archives/wayland-devel/2015-January/019462.html<br /><br />TL;DR: handling it in libinput makes no sense, and apps like games are apparently using evdev directly.<br /><br />Also the non-asked subquestion I was wondering about is: how could kernel know the arrangement of buttons on a gamepad to assign to buttons rational names, like it did with BTTN_LEFT for mouse. The answer is: it don't. There seems to be no way to tell, and, although I didn't look yet at evdev output for gamepad, but apparently the names would be pretty random, like js1, js2, js3, etc.Hi-Angelhttps://www.blogger.com/profile/10661636579329649996noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-57820646047934347752017-03-15T07:01:12.109+10:002017-03-15T07:01:12.109+10:00Yagamy: depends on the kernel driver, HID has mapp...Yagamy: depends on the kernel driver, HID has mappings from HID to evdev, other drivers just set it manually depending on what bits are set in the respective protocols.<br /><br />evdev does have a force-feedback interface but I've never used it, so I can't really explain much about it.Peter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-21711144016198834762017-03-14T20:52:30.852+10:002017-03-14T20:52:30.852+10:00How does kernel know if a device has e.g. BTTN_LEF...How does kernel know if a device has e.g. BTTN_LEFT? I.e. is it written into HID standard that e.g. a particular code a device would send is the BTTN_LEFT?<br /><br />Also I'm wondering, does "force feedback" aka rumble of gamepads handled by evdev protocol too?Hi-Angelhttps://www.blogger.com/profile/10661636579329649996noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-46591005635515456232016-11-07T07:23:05.448+10:002016-11-07T07:23:05.448+10:00Aidan: libinput uses the resolution to convert to ...Aidan: libinput uses the resolution to convert to physical distances. pointer acceleration and other things are based on the phys. distance, so the more correct the resolution is, the more correct the feel from the device will be. On the X/Wayland client side, I don't think it matters too much but there could be specialised cases where it matters (some CAD app or something maybe). Not for touchpads though, that only affects graphics tablets. Peter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-64356933096126000782016-11-06T09:29:09.576+10:002016-11-06T09:29:09.576+10:00Thanks Peter,
Done! That integer division does not...Thanks Peter,<br />Done! That integer division does not bring great accuracy. Maybe I should scale up the max_x and max_y then I could get them closer to reality. Hmm, then I will have steps in the data according to whatever scale factor I might use. Any implications in this from an Apps perspective?Anonymoushttps://www.blogger.com/profile/00152837355495611998noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-13884112104320718482016-11-04T07:00:55.571+10:002016-11-04T07:00:55.571+10:00Aidan: that's for in-kernel code, right? If so...Aidan: that's for in-kernel code, right? If so, it needs to be set separately with input_abs_set_res(), have a look at some of the other drivers. Resolution came quite late (2.6.30) and I guess there's never been a cleanup for those functions to merge them.Peter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-46267567692850994242016-11-04T01:01:31.135+10:002016-11-04T01:01:31.135+10:00Thanks for the info,
You mention the abs parameter...Thanks for the info,<br />You mention the abs parameter 'resolution' but the function 'input_set_abs_params' does not have this variable passed into it. How can one set this parameter?Anonymoushttps://www.blogger.com/profile/00152837355495611998noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-32988818681259962012016-09-21T00:47:47.372+10:002016-09-21T00:47:47.372+10:00Mitja: note that "client" as seen from t...Mitja: note that "client" as seen from the evdev protocol is the userspace process reading i (e.g. libinput), not an X or Wayland client. And yes, with touchpads almost everything including basic pointer motion is implemented in the clientPeter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-37479752696334230472016-09-20T07:31:49.971+10:002016-09-20T07:31:49.971+10:00This hurts my brain, which is why I know it's ...This hurts my brain, which is why I know it's a great technical write-up. :D<br /><br />Thanks for taking the time to write this - and obviously for helping to keep it all working behind the scenes (under the fingers).djbhttps://www.blogger.com/profile/13206790143698555345noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-85487186638447389412016-09-20T00:05:21.215+10:002016-09-20T00:05:21.215+10:00Just wondering - I know you said most of the stuff...Just wondering - I know you said most of the stuff should be implemented by the client, but what about the circular scrolling? Does it fall to the client part as well (since libinput already handles edge/two finger scrolling)?Anonymoushttps://www.blogger.com/profile/08959077854908625403noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-28143469467722414882016-09-19T23:33:45.313+10:002016-09-19T23:33:45.313+10:00just a typo, fixed, thanks.just a typo, fixed, thanks.Peter Huttererhttps://www.blogger.com/profile/17204066043271384535noreply@blogger.comtag:blogger.com,1999:blog-6112936277054198647.post-58346037274199348992016-09-19T21:47:21.302+10:002016-09-19T21:47:21.302+10:00I decided to only read the end. What's a touch...I decided to only read the end. What's a touchpoing? Typo or does it actually mean something.Olavhttps://www.blogger.com/profile/09315812426732221936noreply@blogger.com