Skip to content

Instantly share code, notes, and snippets.

@favio41
Created October 17, 2022 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save favio41/cd05878efb4330777fd97bb3ded87d4d to your computer and use it in GitHub Desktop.
Save favio41/cd05878efb4330777fd97bb3ded87d4d to your computer and use it in GitHub Desktop.
document.addEventListener('keydown', (e) => { if(e.code === 'KeyN') { document.querySelector('.game-controls-item[data-action="pencil"]').dispatchEvent(new MouseEvent('mousedown', {view: window, bubbles: true, cancelable: true })); } } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment