robotjs: Not working on new macOS 10.14 Mojave

Expected Behavior

const robot = require('robotjs');
robot.keyTap('a');
// taps key 'a'

Current Behavior

const robot = require('robotjs');
robot.keyTap('a');
// nothing happens

Possible Solution

Still investigating

Steps to Reproduce (for bugs)

  1. Use a Mac running macOS 10.14
  2. Try running robot.keyTap('a');

Context

We’re using this in our macOS and Windows desktop application to emit keyboard macros

Your Environment

  • RobotJS version: 0.5.1
  • Node.js version: 10.11.0
  • npm version: 6.4.1
  • Operating System: macOS 10.14

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 15

Most upvoted comments

this worked for me!

open System Preferences > Security & Privacy > Accessibility (you might have to unlock the settings by clicking the lock icon in the bottom left hand corner) > check “Terminal” app in the list “Allow the apps below to control your computer”

For me terminal was already checked. Unchecking and rechecking it did the trick! 😃

https://github.com/octalmage/robotjs/issues/548

Mouse stuff seems broken to me in Catalina.

On Mojave the one needs the accessibility permission to send clicks.

screenshot 2018-10-10 at 13 16 03