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

This commit fixes #148: Volume keys don't work on Mac. #171

Merged
merged 2 commits into from
Apr 17, 2016

Conversation

gurel
Copy link
Contributor

@gurel gurel commented Mar 21, 2016

This commit fixes #148: Volume keys don't work on Mac.
Also added brightness, keyboard illumination, play/pause, next/previous

Also added brightness, keyboard illumination, play/pause, next/previous
@gurel
Copy link
Contributor Author

gurel commented Mar 22, 2016

The failure doesn't seem to be related to the commit. =/

@octalmage
Copy link
Owner

@gurel I restarted the build and it passed! Usually just a connection issue. ANYWAY.

This looks great! Can't wait to test it. Thanks for making this happen!

@gurel
Copy link
Contributor Author

gurel commented Apr 4, 2016

There is also something that can be done, which is to map STOP key to PAUSE since there is no stop key on macs. Although it may give more consistency around multiple operating systems.

@@ -6,6 +6,8 @@

#if defined(IS_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
#import <IOKit/hidsystem/IOHIDLib.h>
#import <IOKit/hidsystem/ev_keymap.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind fixing this? These should be hard tabs.

@gurel
Copy link
Contributor Author

gurel commented Apr 12, 2016

Hope this update should covers all the hard tab indents. The IDE default of my javascript editor is spaces. Kinda skipped my mind =).

@octalmage
Copy link
Owner

Awesome! I'll get this merged today. Thanks again, this is so great.

@octalmage
Copy link
Owner

Wow this is a ton of fun. How did you come up with this fix? I'm having trouble finding documentation about it.

Do you know if this will cause any issues on older versions of Mac OS X? Like Yosemite or Mavericks?

Thanks!

@octalmage
Copy link
Owner

Wow nevermind, IOKit goes back far. I'll get this released!

@octalmage octalmage merged commit 73f418a into octalmage:master Apr 17, 2016
@octalmage
Copy link
Owner

I found an issue, the keycodes for the multimedia keys overlap with other keys. For example, for the letter "a", keyCodeRequiresSystemDefinedEvent returns 1. I'm going to give them special keycodes so we can convert them.

@octalmage
Copy link
Owner

Here are the keycodes:

NX_KEYTYPE_MUTE: 7
NX_KEYTYPE_PLAY: 16
NX_KEYTYPE_SOUND_UP: 0
NX_KEYTYPE_SOUND_DOWN: 1
NX_KEYTYPE_BRIGHTNESS_UP: 2
NX_KEYTYPE_BRIGHTNESS_DOWN: 3
NX_KEYTYPE_PLAY: 16
NX_KEYTYPE_PREVIOUS: 18
NX_KEYTYPE_NEXT: 17
NX_KEYTYPE_ILLUMINATION_UP: 21
NX_KEYTYPE_ILLUMINATION_DOWN: 22
NX_KEYTYPE_ILLUMINATION_TOGGLE: 23

@octalmage
Copy link
Owner

Fixed in #180! Released in RobotJS v0.4.1.

@gurel
Copy link
Contributor Author

gurel commented Apr 27, 2016

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

Successfully merging this pull request may close these issues.

Volume keys don't work on Mac.
2 participants