{"action":"created","issue":{"url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/2","repository_url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick","labels_url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/2/comments","events_url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/2/events","html_url":"https://github.com/Zyell/Python-Touchscreen-RightClick/issues/2","id":181389447,"number":2,"title":"ui.write and device capabilities issues ","user":{"login":"gevasiliou","id":19711053,"avatar_url":"https://avatars.githubusercontent.com/u/19711053?v=3","gravatar_id":"","url":"https://api.github.com/users/gevasiliou","html_url":"https://github.com/gevasiliou","followers_url":"https://api.github.com/users/gevasiliou/followers","following_url":"https://api.github.com/users/gevasiliou/following{/other_user}","gists_url":"https://api.github.com/users/gevasiliou/gists{/gist_id}","starred_url":"https://api.github.com/users/gevasiliou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gevasiliou/subscriptions","organizations_url":"https://api.github.com/users/gevasiliou/orgs","repos_url":"https://api.github.com/users/gevasiliou/repos","events_url":"https://api.github.com/users/gevasiliou/events{/privacy}","received_events_url":"https://api.github.com/users/gevasiliou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-06T11:24:44Z","updated_at":"2016-10-10T00:21:18Z","closed_at":null,"body":"Hello,\r\nYour script is really nice.\r\nI have a convertible Toshiba laptop with ELAN Screen running Debian 8.5 Sid & XFCE, but i had some issues with the UInput and ui.write method.\r\n\r\nIn my system , the code as described in _initiate_right_click does not work.\r\nThe problem turned out to be the device capabilites declaration.\r\nInstead of this:\r\n>         capabilities = {ecodes.EV_ABS: (ecodes.ABS_X, ecodes.ABS_Y),\r\n>                         ecodes.EV_KEY: (ecodes.BTN_LEFT, ecodes.BTN_RIGHT)}\r\n\r\nI had to use this:\r\n>         capabilities = {\r\n> \t\tecodes.EV_KEY : [ecodes.BTN_LEFT, ecodes.BTN_RIGHT],\r\n> \t\tecodes.EV_ABS : [(ecodes.ABS_X, AbsInfo(value=1900, min=0, max=3264, fuzz=0, flat=0, resolution=13)), (ecodes.ABS_Y, AbsInfo(1050, 0, 1856, 0, 0, 13))]\r\n> \t     }\r\n\r\nI had to apply to AbsInfo min,max,fuzz,flat and resolution values same as my ELAN screen capabilites.\r\n\r\nPS1: In any case, i forked your script and i used pymouse for right click injection insted of UInput.  \r\n\r\nPS2: I also had to modify the position_event part of your script, since in my screen when i'm working with fingers i have a slight change in ABS_X and ABS_Y values when i keep pressing my screen in one point probably due to the high resolution of the screen. \r\nThis small change cancels the right click event to be injected , so i modified like bellow to allow +/- 50 pixels movement without cancelling right click:\r\n\r\n```\r\nif self.position[event_code] is None:\r\n    self.position[event_code] = value\r\nelse:\r\n    OldValue = self.position[event_code] \r\n    NewValue = value\r\n    diff = OldValue - NewValue\r\n    if abs(diff) > 50:   \r\n        self._moved_event()\r\n```\r\n\r\nAfter above modifications, your script works great for me. \r\nThe touchscreen gestures trap works like a charm.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/comments/252523138","html_url":"https://github.com/Zyell/Python-Touchscreen-RightClick/issues/2#issuecomment-252523138","issue_url":"https://api.github.com/repos/Zyell/Python-Touchscreen-RightClick/issues/2","id":252523138,"user":{"login":"gevasiliou","id":19711053,"avatar_url":"https://avatars.githubusercontent.com/u/19711053?v=3","gravatar_id":"","url":"https://api.github.com/users/gevasiliou","html_url":"https://github.com/gevasiliou","followers_url":"https://api.github.com/users/gevasiliou/followers","following_url":"https://api.github.com/users/gevasiliou/following{/other_user}","gists_url":"https://api.github.com/users/gevasiliou/gists{/gist_id}","starred_url":"https://api.github.com/users/gevasiliou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gevasiliou/subscriptions","organizations_url":"https://api.github.com/users/gevasiliou/orgs","repos_url":"https://api.github.com/users/gevasiliou/repos","events_url":"https://api.github.com/users/gevasiliou/events{/privacy}","received_events_url":"https://api.github.com/users/gevasiliou/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T00:21:18Z","updated_at":"2016-10-10T00:21:18Z","body":"Hello,\r\nThank you for your feedback.\r\nI have to try your modified code and let you know for the results.\r\n\r\nIn the mean time, i got some more ideas that you might find interesting:\r\n\r\n1. instead of applying res-x and res-y to a fixed value of 13 (which is also suitable for my ELAN), you could use the real value reported by real ELAN device capabilities using ui.capabilities(verbose=True,absinfo=True)).\r\nThus you can ensure that AbsInfo method for the uinput device will work in all screens / all cases.\r\n\r\n2. I\r\n\r\n3, It would be very interesting to modify the script by injecting the right click while we keep pressing the screen . It is quite common for users to expect first to see the right click menu and then to remove fingers. This is something i'm working on in your forked script, but still i need long way (and time) to go.\r\n\r\nRegards,\r\nGeorge V.\r\n"}}
{"actor":{"display_login":"gevasiliou"}}