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?
[ Parent
| on HN ]
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...)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()