Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media keys don't work on Mac #167

Closed
Mastergalen opened this issue Mar 10, 2016 · 1 comment
Closed

Media keys don't work on Mac #167

Mastergalen opened this issue Mar 10, 2016 · 1 comment

Comments

@Mastergalen
Copy link

I'm running the same code on both my Windows Desktop and my Mac. Nothing wrong when running it on Windows.

On Mac I'm getting the following error:

/Users/galenhan/GitHub/RPlayr/server/server.js:13
robot.keyTap("audio_pause");
      ^

Error: Invalid key code specified.
    at Error (native)
    at Object.<anonymous> (/Users/galenhan/GitHub/RPlayr/server/server.js:13:7)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

The code for server.js are just these 2 lines:

var robot = require("robotjs");

robot.keyTap("audio_pause");

Tried it with other keys such as audio_next and audio_mute.


Oddly enough

robot.keyTap("audio_mute");

doesn't crash the program, but doesn't actually mute any sound my Mac.


The keyboard demo

//Type "Hello World" then press enter.
var robot = require("robotjs");

//Type "Hello World".
robot.typeString("Hello World");

//Press enter. 
robot.keyTap("enter");

works without problems on Mac by the way.

Running OSX El Capitan 10.11.3.

@octalmage
Copy link
Owner

Hey @Mastergalen! Currently the media keys don't work on Mac, you can follow this issue for updates:

#148

Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants