DuckDuckGo Wacom scroll fix

Wacom tablets with touch enabled send left and right arrow keypresses when you scroll sideways, which is annoying for DDG users.

  1. // ==UserScript==
  2. // @name DuckDuckGo Wacom scroll fix
  3. // @description Wacom tablets with touch enabled send left and right arrow keypresses when you scroll sideways, which is annoying for DDG users.
  4. // @grant unsafeWindow
  5. // @version 0.1
  6. // @match *://*.duckduckgo.com/*
  7. // @namespace https://pureandapplied.com.au/DDGWacomFix
  8.  
  9.  
  10. // ==/UserScript==
  11. (function(){
  12. unsafeWindow.document.addEventListener('keydown', function(e) {
  13.  
  14. if (e.keyCode === 37 || e.keyCode === 39) {
  15. // block left and right keypresses to DDG
  16. e.stopImmediatePropagation();
  17. return;
  18. }
  19. }, true);
  20. })();