{"action":"created","comment":{"url":"https://api.github.com/repos/novnc/noVNC/pulls/comments/138345031","pull_request_review_id":62126893,"id":138345031,"diff_hunk":"@@ -108,27 +116,74 @@ Mouse.prototype = {\n         this._handleMouseButton(e, 0);\n     },\n \n+    // Mouse wheel events are sent in steps over VNC. This means that the VNC\n+    // protocol can't handle a wheel event with specific distance or speed.\n+    // Therefor, if we get a lot of small mouse wheel events we combine them.\n+    _generateWheelStepX: function (pos) {\n+\n+        if (this._accumulatedWheelDeltaX < 0) {\n+            this._onMouseButton(pos.x, pos.y, 1, 1 << 5);\n+            this._onMouseButton(pos.x, pos.y, 0, 1 << 5);\n+        } else if (this._accumulatedWheelDeltaX > 0) {\n+            this._onMouseButton(pos.x, pos.y, 1, 1 << 6);\n+            this._onMouseButton(pos.x, pos.y, 0, 1 << 6);\n+        }\n+\n+        this._accumulatedWheelDeltaX = 0;\n+    },\n+\n+    _generateWheelStepY: function (pos) {\n+\n+        if (this._accumulatedWheelDeltaY < 0) {\n+            this._onMouseButton(pos.x, pos.y, 1, 1 << 3);\n+            this._onMouseButton(pos.x, pos.y, 0, 1 << 3);\n+        } else if (this._accumulatedWheelDeltaY > 0) {\n+            this._onMouseButton(pos.x, pos.y, 1, 1 << 4);\n+            this._onMouseButton(pos.x, pos.y, 0, 1 << 4);\n+        }\n+\n+        this._accumulatedWheelDeltaY = 0;\n+    },\n+\n     _handleMouseWheel: function (e) {\n-        if (!this._focused) { return; }\n+        if (!this._focused || !this._onMouseButton) { return; }\n+\n+        window.clearTimeout(this._wheelStepXTimer);\n+        window.clearTimeout(this._wheelStepYTimer);","path":"core/input/mouse.js","position":null,"original_position":59,"commit_id":"61339f2b45a8080d3309ca1bef98346096a8e51d","original_commit_id":"61339f2b45a8080d3309ca1bef98346096a8e51d","user":{"login":"samhed","id":4117162,"avatar_url":"https://avatars0.githubusercontent.com/u/4117162?v=4","gravatar_id":"","url":"https://api.github.com/users/samhed","html_url":"https://github.com/samhed","followers_url":"https://api.github.com/users/samhed/followers","following_url":"https://api.github.com/users/samhed/following{/other_user}","gists_url":"https://api.github.com/users/samhed/gists{/gist_id}","starred_url":"https://api.github.com/users/samhed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samhed/subscriptions","organizations_url":"https://api.github.com/users/samhed/orgs","repos_url":"https://api.github.com/users/samhed/repos","events_url":"https://api.github.com/users/samhed/events{/privacy}","received_events_url":"https://api.github.com/users/samhed/received_events","type":"User","site_admin":false},"body":"Good point!","created_at":"2017-09-12T13:22:38Z","updated_at":"2017-09-12T13:22:39Z","html_url":"https://github.com/novnc/noVNC/pull/896#discussion_r138345031","pull_request_url":"https://api.github.com/repos/novnc/noVNC/pulls/896","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/comments/138345031"},"html":{"href":"https://github.com/novnc/noVNC/pull/896#discussion_r138345031"},"pull_request":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/896"}},"in_reply_to_id":138337633},"pull_request":{"url":"https://api.github.com/repos/novnc/noVNC/pulls/896","id":140533967,"html_url":"https://github.com/novnc/noVNC/pull/896","diff_url":"https://github.com/novnc/noVNC/pull/896.diff","patch_url":"https://github.com/novnc/noVNC/pull/896.patch","issue_url":"https://api.github.com/repos/novnc/noVNC/issues/896","number":896,"state":"open","locked":false,"title":"Combine small mouse wheel events","user":{"login":"samhed","id":4117162,"avatar_url":"https://avatars0.githubusercontent.com/u/4117162?v=4","gravatar_id":"","url":"https://api.github.com/users/samhed","html_url":"https://github.com/samhed","followers_url":"https://api.github.com/users/samhed/followers","following_url":"https://api.github.com/users/samhed/following{/other_user}","gists_url":"https://api.github.com/users/samhed/gists{/gist_id}","starred_url":"https://api.github.com/users/samhed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samhed/subscriptions","organizations_url":"https://api.github.com/users/samhed/orgs","repos_url":"https://api.github.com/users/samhed/repos","events_url":"https://api.github.com/users/samhed/events{/privacy}","received_events_url":"https://api.github.com/users/samhed/received_events","type":"User","site_admin":false},"body":"The VNC protocol can't handle different deltas or speeds for a mouse wheel event. When using a device that sends a lot of small mouse wheel events, instead of fewer larger steps, the effect was that mouse wheel scrolling was way to sensitive.\r\nThis patch looks at the delta of wheel events and doesn't send events until the combined delta has passed a threshold. Single events that doesn't pass the threshold get sent after a timeout in order to not loose any events.\r\n\r\nFixes #577 ","created_at":"2017-09-12T09:47:11Z","updated_at":"2017-09-12T13:22:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b737b61f0bdb008075efdda1060470ab4289c966","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/novnc/noVNC/milestones/2","html_url":"https://github.com/novnc/noVNC/milestone/2","labels_url":"https://api.github.com/repos/novnc/noVNC/milestones/2/labels","id":2010059,"number":2,"title":"v0.7.0","description":"","creator":{"login":"DirectXMan12","id":119737,"avatar_url":"https://avatars1.githubusercontent.com/u/119737?v=4","gravatar_id":"","url":"https://api.github.com/users/DirectXMan12","html_url":"https://github.com/DirectXMan12","followers_url":"https://api.github.com/users/DirectXMan12/followers","following_url":"https://api.github.com/users/DirectXMan12/following{/other_user}","gists_url":"https://api.github.com/users/DirectXMan12/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectXMan12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectXMan12/subscriptions","organizations_url":"https://api.github.com/users/DirectXMan12/orgs","repos_url":"https://api.github.com/users/DirectXMan12/repos","events_url":"https://api.github.com/users/DirectXMan12/events{/privacy}","received_events_url":"https://api.github.com/users/DirectXMan12/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":72,"state":"open","created_at":"2016-09-16T20:17:49Z","updated_at":"2017-09-12T10:04:21Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/novnc/noVNC/pulls/896/commits","review_comments_url":"https://api.github.com/repos/novnc/noVNC/pulls/896/comments","review_comment_url":"https://api.github.com/repos/novnc/noVNC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/novnc/noVNC/issues/896/comments","statuses_url":"https://api.github.com/repos/novnc/noVNC/statuses/61339f2b45a8080d3309ca1bef98346096a8e51d","head":{"label":"novnc:combinemousewheel","ref":"combinemousewheel","sha":"61339f2b45a8080d3309ca1bef98346096a8e51d","user":{"login":"novnc","id":24572588,"avatar_url":"https://avatars2.githubusercontent.com/u/24572588?v=4","gravatar_id":"","url":"https://api.github.com/users/novnc","html_url":"https://github.com/novnc","followers_url":"https://api.github.com/users/novnc/followers","following_url":"https://api.github.com/users/novnc/following{/other_user}","gists_url":"https://api.github.com/users/novnc/gists{/gist_id}","starred_url":"https://api.github.com/users/novnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novnc/subscriptions","organizations_url":"https://api.github.com/users/novnc/orgs","repos_url":"https://api.github.com/users/novnc/repos","events_url":"https://api.github.com/users/novnc/events{/privacy}","received_events_url":"https://api.github.com/users/novnc/received_events","type":"Organization","site_admin":false},"repo":{"id":598164,"name":"noVNC","full_name":"novnc/noVNC","owner":{"login":"novnc","id":24572588,"avatar_url":"https://avatars2.githubusercontent.com/u/24572588?v=4","gravatar_id":"","url":"https://api.github.com/users/novnc","html_url":"https://github.com/novnc","followers_url":"https://api.github.com/users/novnc/followers","following_url":"https://api.github.com/users/novnc/following{/other_user}","gists_url":"https://api.github.com/users/novnc/gists{/gist_id}","starred_url":"https://api.github.com/users/novnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novnc/subscriptions","organizations_url":"https://api.github.com/users/novnc/orgs","repos_url":"https://api.github.com/users/novnc/repos","events_url":"https://api.github.com/users/novnc/events{/privacy}","received_events_url":"https://api.github.com/users/novnc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novnc/noVNC","description":"VNC client using HTML5 (Web Sockets, Canvas) with encryption (wss://) support.","fork":false,"url":"https://api.github.com/repos/novnc/noVNC","forks_url":"https://api.github.com/repos/novnc/noVNC/forks","keys_url":"https://api.github.com/repos/novnc/noVNC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novnc/noVNC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novnc/noVNC/teams","hooks_url":"https://api.github.com/repos/novnc/noVNC/hooks","issue_events_url":"https://api.github.com/repos/novnc/noVNC/issues/events{/number}","events_url":"https://api.github.com/repos/novnc/noVNC/events","assignees_url":"https://api.github.com/repos/novnc/noVNC/assignees{/user}","branches_url":"https://api.github.com/repos/novnc/noVNC/branches{/branch}","tags_url":"https://api.github.com/repos/novnc/noVNC/tags","blobs_url":"https://api.github.com/repos/novnc/noVNC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novnc/noVNC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novnc/noVNC/git/refs{/sha}","trees_url":"https://api.github.com/repos/novnc/noVNC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novnc/noVNC/statuses/{sha}","languages_url":"https://api.github.com/repos/novnc/noVNC/languages","stargazers_url":"https://api.github.com/repos/novnc/noVNC/stargazers","contributors_url":"https://api.github.com/repos/novnc/noVNC/contributors","subscribers_url":"https://api.github.com/repos/novnc/noVNC/subscribers","subscription_url":"https://api.github.com/repos/novnc/noVNC/subscription","commits_url":"https://api.github.com/repos/novnc/noVNC/commits{/sha}","git_commits_url":"https://api.github.com/repos/novnc/noVNC/git/commits{/sha}","comments_url":"https://api.github.com/repos/novnc/noVNC/comments{/number}","issue_comment_url":"https://api.github.com/repos/novnc/noVNC/issues/comments{/number}","contents_url":"https://api.github.com/repos/novnc/noVNC/contents/{+path}","compare_url":"https://api.github.com/repos/novnc/noVNC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novnc/noVNC/merges","archive_url":"https://api.github.com/repos/novnc/noVNC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novnc/noVNC/downloads","issues_url":"https://api.github.com/repos/novnc/noVNC/issues{/number}","pulls_url":"https://api.github.com/repos/novnc/noVNC/pulls{/number}","milestones_url":"https://api.github.com/repos/novnc/noVNC/milestones{/number}","notifications_url":"https://api.github.com/repos/novnc/noVNC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novnc/noVNC/labels{/name}","releases_url":"https://api.github.com/repos/novnc/noVNC/releases{/id}","deployments_url":"https://api.github.com/repos/novnc/noVNC/deployments","created_at":"2010-04-07T01:55:44Z","updated_at":"2017-09-12T01:40:23Z","pushed_at":"2017-09-12T09:47:13Z","git_url":"git://github.com/novnc/noVNC.git","ssh_url":"git@github.com:novnc/noVNC.git","clone_url":"https://github.com/novnc/noVNC.git","svn_url":"https://github.com/novnc/noVNC","homepage":"novnc.com","size":7850,"stargazers_count":3658,"watchers_count":3658,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":792,"mirror_url":null,"open_issues_count":72,"forks":792,"open_issues":72,"watchers":3658,"default_branch":"master"}},"base":{"label":"novnc:master","ref":"master","sha":"a49ade5fa057cf55b3c35a333fb5e364a5577e30","user":{"login":"novnc","id":24572588,"avatar_url":"https://avatars2.githubusercontent.com/u/24572588?v=4","gravatar_id":"","url":"https://api.github.com/users/novnc","html_url":"https://github.com/novnc","followers_url":"https://api.github.com/users/novnc/followers","following_url":"https://api.github.com/users/novnc/following{/other_user}","gists_url":"https://api.github.com/users/novnc/gists{/gist_id}","starred_url":"https://api.github.com/users/novnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novnc/subscriptions","organizations_url":"https://api.github.com/users/novnc/orgs","repos_url":"https://api.github.com/users/novnc/repos","events_url":"https://api.github.com/users/novnc/events{/privacy}","received_events_url":"https://api.github.com/users/novnc/received_events","type":"Organization","site_admin":false},"repo":{"id":598164,"name":"noVNC","full_name":"novnc/noVNC","owner":{"login":"novnc","id":24572588,"avatar_url":"https://avatars2.githubusercontent.com/u/24572588?v=4","gravatar_id":"","url":"https://api.github.com/users/novnc","html_url":"https://github.com/novnc","followers_url":"https://api.github.com/users/novnc/followers","following_url":"https://api.github.com/users/novnc/following{/other_user}","gists_url":"https://api.github.com/users/novnc/gists{/gist_id}","starred_url":"https://api.github.com/users/novnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novnc/subscriptions","organizations_url":"https://api.github.com/users/novnc/orgs","repos_url":"https://api.github.com/users/novnc/repos","events_url":"https://api.github.com/users/novnc/events{/privacy}","received_events_url":"https://api.github.com/users/novnc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novnc/noVNC","description":"VNC client using HTML5 (Web Sockets, Canvas) with encryption (wss://) support.","fork":false,"url":"https://api.github.com/repos/novnc/noVNC","forks_url":"https://api.github.com/repos/novnc/noVNC/forks","keys_url":"https://api.github.com/repos/novnc/noVNC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novnc/noVNC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novnc/noVNC/teams","hooks_url":"https://api.github.com/repos/novnc/noVNC/hooks","issue_events_url":"https://api.github.com/repos/novnc/noVNC/issues/events{/number}","events_url":"https://api.github.com/repos/novnc/noVNC/events","assignees_url":"https://api.github.com/repos/novnc/noVNC/assignees{/user}","branches_url":"https://api.github.com/repos/novnc/noVNC/branches{/branch}","tags_url":"https://api.github.com/repos/novnc/noVNC/tags","blobs_url":"https://api.github.com/repos/novnc/noVNC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novnc/noVNC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novnc/noVNC/git/refs{/sha}","trees_url":"https://api.github.com/repos/novnc/noVNC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novnc/noVNC/statuses/{sha}","languages_url":"https://api.github.com/repos/novnc/noVNC/languages","stargazers_url":"https://api.github.com/repos/novnc/noVNC/stargazers","contributors_url":"https://api.github.com/repos/novnc/noVNC/contributors","subscribers_url":"https://api.github.com/repos/novnc/noVNC/subscribers","subscription_url":"https://api.github.com/repos/novnc/noVNC/subscription","commits_url":"https://api.github.com/repos/novnc/noVNC/commits{/sha}","git_commits_url":"https://api.github.com/repos/novnc/noVNC/git/commits{/sha}","comments_url":"https://api.github.com/repos/novnc/noVNC/comments{/number}","issue_comment_url":"https://api.github.com/repos/novnc/noVNC/issues/comments{/number}","contents_url":"https://api.github.com/repos/novnc/noVNC/contents/{+path}","compare_url":"https://api.github.com/repos/novnc/noVNC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novnc/noVNC/merges","archive_url":"https://api.github.com/repos/novnc/noVNC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novnc/noVNC/downloads","issues_url":"https://api.github.com/repos/novnc/noVNC/issues{/number}","pulls_url":"https://api.github.com/repos/novnc/noVNC/pulls{/number}","milestones_url":"https://api.github.com/repos/novnc/noVNC/milestones{/number}","notifications_url":"https://api.github.com/repos/novnc/noVNC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novnc/noVNC/labels{/name}","releases_url":"https://api.github.com/repos/novnc/noVNC/releases{/id}","deployments_url":"https://api.github.com/repos/novnc/noVNC/deployments","created_at":"2010-04-07T01:55:44Z","updated_at":"2017-09-12T01:40:23Z","pushed_at":"2017-09-12T09:47:13Z","git_url":"git://github.com/novnc/noVNC.git","ssh_url":"git@github.com:novnc/noVNC.git","clone_url":"https://github.com/novnc/noVNC.git","svn_url":"https://github.com/novnc/noVNC","homepage":"novnc.com","size":7850,"stargazers_count":3658,"watchers_count":3658,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":792,"mirror_url":null,"open_issues_count":72,"forks":792,"open_issues":72,"watchers":3658,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/896"},"html":{"href":"https://github.com/novnc/noVNC/pull/896"},"issue":{"href":"https://api.github.com/repos/novnc/noVNC/issues/896"},"comments":{"href":"https://api.github.com/repos/novnc/noVNC/issues/896/comments"},"review_comments":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/896/comments"},"review_comment":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/novnc/noVNC/pulls/896/commits"},"statuses":{"href":"https://api.github.com/repos/novnc/noVNC/statuses/61339f2b45a8080d3309ca1bef98346096a8e51d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"samhed"}}