Skip to content

keyToggle doesn't hit shift and command together #405

@relsqui

Description

@relsqui

Expected Behavior

I used keyToggle to hold down shift and command, and used the Mac keyboard viewer to observe what keys were being pressed. The expected result was that both shift and command would be highlighted on the keyboard viewer.

Current Behavior

Only shift was pressed:

keytoggle-cropped

If I reversed it so that it was holding command-with-shift instead of shift-with-command, only command was pressed.

Notably, the equivalent on Windows (using shift and control) is working fine! I didn't make a minimal repro for it, but the real script succeeds in Windows where it fails on Mac.

Steps to Reproduce (for bugs)

Here's the code I used to test:

var robot = require('robotjs');

robot.keyToggle('shift', 'down', 'command');

Context

The actual thing I'm trying to do is ctrl-shift-click on something, so merging #356 would be a better long-term solution for me -- but this seems like an unexpected behavior you'd probably want to know about anyway. :)

Your Environment

  • RobotJS version: 0.5.1
  • Node.js version: 9.8.0
  • npm version: 5.7.1
  • Operating System: macOS 10.13.4 (High Sierra)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions