-
Notifications
You must be signed in to change notification settings - Fork 981
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
Added left and right control keys #261
Conversation
I also need Right Control. I tried building this PR on Windows, and this is the output I get:
Which looks like it built fine. But when I try to use right control, I get the following exception:
|
I figured it out, using this won't work: robot.keyTap('c', 'right_control'); because robot.keyToggle('right_control', 'down');
robot.keyTap('c');
robot.keyToggle('right_control', 'up'); |
@danieltian Thanks for testing on Windows! Now if only we could get a Mac build tested... |
Mac build looks like it's working. Should be merged. But I'd say fix the bug as mentioned above. |
Awesome. Thanks @rj0495 . I'll have to get my environment set up again (drive died on me in a spectacular way a week or so ago) and get the bug taken care of. |
This is to fix the bug in octalmage#261 . Haven't tested it yet since I don't have a working environment yet, but I cannot find anything in the platform documentations that specify a left or right control mask different from the mask that is currently assigned to `MOD_CONTROL` in `keypress.h`. Oh, and this also extends the functionality to `right_shift` as well
Sorry everyone, releasing and building is currently difficult since I have to spin up a bunch of VMs. I'm going to work on getting TravisCI publishing so it's easier to test and deploy. Thanks for the PR! |
Oh. Wow. I suppose I should fix that bug... unless I already did and I forgot Edit: Looks like I did. I guess I'll go see what the appveyor hub-ub is all about Edit - Electric Boogaloo: Looks like Appveyor was running old versions of Node that don't like the unit tests |
Oh and no problem! Happy that I was able to extend and help others :) |
Thank you for your PR! |
This is to fix the bug in octalmage/robotjs#261 . Haven't tested it yet since I don't have a working environment yet, but I cannot find anything in the platform documentations that specify a left or right control mask different from the mask that is currently assigned to `MOD_CONTROL` in `keypress.h`. Oh, and this also extends the functionality to `right_shift` as well
I have a use case where my application has to distinguish between left and right control keys (automating Farming Simulator). I think this is all that needs to be done. I've looked up the proper Linux, MacOS, and Windows keycodes (or at least what a quick Googlin' says is proper). It builds in my Debian Jessie VM. My Windows environment isn't set up for C/C++ development and I don't have access to a Mac so this would need to be built and tested on those systems.
I noticed there are two references in the
keypress.c
(if (flags & MOD_CONTROL) WIN32_KEY_EVENT_WAIT(K_CONTROL, dwFlags);
andif (flags & MOD_CONTROL) X_KEY_EVENT_WAIT(display, K_CONTROL, is_press);
) for Windows and Linux respectively to (I'm guessing) deal with using the ctrl keys as modifiers. Would this need modifying here to make sure that the proper ctrl key is used as a modifier?I'm pretty much flying blind here, but the ability to distinguish between left and right control keys is a must have for me (and I'm sure others). I'm willing to work with the maintainers on making sure this code is correct and working.
Thanks