News for hackers. Stuff that matters.
Re:RobotJS – Node.js Desktop Automation by rolux on Thursday July 30, 2015 @09:09AM (#9974627)
Ah, thanks for the pointer!

    keyboard.type('foo');
    keyboard.press('fn');
... makes much more sense.
Re:RobotJS – Node.js Desktop Automation by hugs on Thursday July 30, 2015 @10:23AM (#9975135)
I'd go for as short (but still readable) as possible.

  > robot.keys("Type a string")

  > robot.keys(ENTER)   // ENTER is an integer key value
(I've been thinking about this while trying to make an idiomatic node client for Selenium WebDriver... https://github.com/hugs/34#api)
Re:RobotJS – Node.js Desktop Automation by smilekzs on Thursday July 30, 2015 @10:39AM (#9975247)
Importing enum values into global/function/module local namespace has always been a PITA for javascript environments. Any suggestion on how to do this cleanly?
Re:RobotJS – Node.js Desktop Automation by hugs on Thursday July 30, 2015 @10:50AM (#9975336)
I'm sure it's possible, but one way to avoid it -- turn the constant into a method:

  > robot.keys.ENTER()
(Not great for key combos, though...)
Re:RobotJS – Node.js Desktop Automation by nunull on Thursday July 30, 2015 @11:19AM (#9975581)
I'd then go with

  robot.keys.enter()
(since enter is a function, not a constant) and make it chainable by returning `robot.keys`.

  robot.keys.ctrl().enter()
Re:RobotJS – Node.js Desktop Automation by swsieber on Thursday July 30, 2015 @04:49PM (#9977972)
You'd probably want something slightly different than keys - at least some way to different between key presses and hold the keys down at the same time.