octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.37k stars 961 forks source link

Linux: Keytap is broken on master branch as of #527 #566

Closed FossPrime closed 4 years ago

FossPrime commented 4 years ago

Keytap is completely broken on master as of the #527 merge

Running:

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

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

Yields no output whatsoever.

Tests

$ npx jasmine test/**/*.js
Started
Invalid MIT-MAGIC-COOKIE-1 keyF...F

Failures:
1) Integration/Keyboard types
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at listOnTimeout (internal/timers.js:531:17)
        at processTimers (internal/timers.js:475:7)

2) Integration/Screen reads a pixel color
  Message:
    Expected 'ffffff' to equal 'c0ff33'.
  Stack:
    Error: Expected 'ffffff' to equal 'c0ff33'.
        at UserContext.<anonymous> (/home/amama/git/ray/unix/robot/node_modules/robotjs/test/integration/screen.js:23:17)

5 specs, 2 failures
Finished in 10.673 seconds

Solution

Keytap is now backed by unicodeTap(const unsigned value)... which does not implement any default os or Linux.

Your Environment

FossPrime commented 4 years ago

Fixed in merged PR.