Comments (34)
So far I've only tested RobotJS on Mac, although technically the code is cross platform. The build script probably needs to be modified.
You we're able to get it installed? What part doesn't work? Do you get any errors?
Thanks!
from robotjs.
After installing the xorg-dev I successfully installed the robotjs but following the demo resulted in error messages:
> var robot = require("robotjs");
undefined
> var mouse=robot.getMousePos();
node: symbol lookup error: /home/amih3/tmp/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: XGetMainDisplay
I hope this helps, thank you!
from robotjs.
Could you try installing ibxtst-dev?
sudo apt-get install ibxtst-dev
I believe this should resolve the issue.
from robotjs.
Ah, you mean libxtst-dev
(I assume). Still doesn't work but I'm having a look at the build script and seeing if I can work it out :)
from robotjs.
@amih, @DamonOehlman was able to get RobotJS building for Linux and I merged his pull request. Could you try the latest code to see if it works?
@DamonOehlman were there any additional packages needed?
from robotjs.
Nope, xorg-dev
was all that was required and I suspect we can get it down to a tighter list also, but I haven't investigated that as yet...
from robotjs.
Awesome!
So libxtst-dev
wasn't needed after all?
from robotjs.
I think it was, but was brought in as a dependency of xorg-dev
. Let me uninstall xorg-dev
and I'll try and identify the specific packages that are required.
from robotjs.
OK, I looks like libxtst-dev
is the best package to require as a dependency as bringing it in also brings in libx11-dev
which is also required. I did however also specify png
and z
as required link settings as these were expressed as dependencies in autopy.
from robotjs.
Great, thanks again for your help. I'll get the readme updated and a new version out tonight. z and png may not be needed now, but they will be necessary dependencies as soon as I finish the screen and bitmap modules.
from robotjs.
I'll confirm in a VM and close this out also.
from robotjs.
Now I can start with continual integration and unit testing. I'm excited.
from robotjs.
Nice. Note some changes for travis around the new docker containers around installing APT packages but yeah this should be pretty easy to test there :)
from robotjs.
I tried building it on my machine under Ubuntu 14.10 and I ran into a dependency issue with a few items:
One was installing npm install nan
for node-gyp.
The other dependency I ran across was a libgd-dev error on node-gyp build
which prompted:/usr/bin/ld: cannot find -lpng
.
sudo apt-get install libgd-dev
resolved the /usr/bin/ld: cannot find -lpng
message.
from robotjs.
In testing with @JohnDittmar we found that some functions don't work on Ubuntu, like keyTap and getPixelColor. These need to be working before I update the readme and close this.
from robotjs.
Sure thing - if I get some more time I'll investigate and see if I can work out what's required.
from robotjs.
Same here! I believe one issue is the snprintf function in getPixelColor.
from robotjs.
Is there any solution for node: symbol lookup error: /home/amih3/tmp/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: XGetMainDisplay
?
System info:
node v0.12.0
Ubuntu 12.04.1
Also problem exist for other functions
getMousePos => XGetMainDisplay
typeString => XStringToKeysym
getPixelColor => XOpenDisplay
from robotjs.
The Linux build still needs a lot of work, unfortunately I don't know a solution currently. probably missing includes or compiler flags.
from robotjs.
Actually, did you try the code in this repository? Or just install using NPM?
from robotjs.
Yesterday I use npm i robotjs
.
Now npm i git+https://[email protected]/octalmage/robotjs.git
fixed problem. getMousePos
and typeString
work correctly.
but new buffer overflow problem occurred with getPixelColor explained in #19
from robotjs.
Great! I have an idea about getPixelColor, unfortunately it's not convenient for me to work on Linux.
from robotjs.
For anyone who may have the same issue on debian, X11/extensions/XTest.h
is provided by libxtst-dev
.
from robotjs.
Could someone let me know if this code works with RobotJS from the master branch?
var robot = require("robotjs");
//Press space.
robot.keyTap("space");
I just added space to keyTap, but I'm unsure if I got the Linux keycode right. See: 523cf3b.
from robotjs.
Nevermind! I used my VM to test, and I was wrong. I fixed it in e935825 though.
Finally found the correct keycode in this code:
https://gitlab.com/higan/higan/blob/3ce1d19f7a6890b410f1687ea88759b3aff6a367/ruby/input/keyboard/xlib.cpp#L283
from robotjs.
Ok I fixed the issue with gePixelColor
#19, but the returned colors seem off.
Could someone double check this?
Thanks!
Edit: I just ran some tests using Ubuntu and every other function works fine. getPixelColor
is the last issue, if there is an issue.
from robotjs.
I test it on ubuntu. it works.
$ node index.js # readme example output.
#c80003 at x:1007 y:474
my os:
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
from robotjs.
@smmoosavi Awesome! Does the hex match the screen?
from robotjs.
yes, mouse is on red color when I run js file.
from robotjs.
Great! Then it looks like we have full Linux support. I'll close this in a few days, just want to confirm everything is working as expected.
from robotjs.
I've done some additional testing and I'm going to consider this closed!
from robotjs.
should add a comment in README to help user setup build environment on ubuntu,
sudo apt-get install libxtst-dev libpng++-dev
from robotjs.
Yeah for sure, Windows and Mac need instructions also. I'll work on this today.
from robotjs.
Hi octalmage,
First of all, GREAT PROJECT! I tested it on a windows machine and it works like a charm, but now I am trying to install it on an Ubuntu (zorin) laptop and I got a few error and I got stuck on one.
The last one is:
Error: /home/a/test/robotjs/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: YTestFakeButtonEvent
at Error (native)
at Object.Module._extensions..node (module.js:435:18)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/a/test/robotjs/node_modules/robotjs/index.js:1:77)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
Any idea what can it be?
Sorry if its a stupid one, I am not using linux too much...
Thanks a lot for your efforts!
I am trying to support this project as much as I can.
from robotjs.
Related Issues (20)
- install robotjs is confused, why not provider package like nutjs HOT 2
- Mouse pointer doesn't work in locked screen of MacOS while using screen share app
- [Bug]: Fatal error in V8: v8 ArrayBuffer NewBackingStore When the V8 Sandbox is enabled, ArrayBuffer backing stores must be allocated inside the sandbox address space. Please use an appropriate ArrayBuffer::Allocator to allocate these buffers, or disable the sandbox. HOT 1
- Multiple compile warnings and an error in 0.6.0 with node 16.14.2 - error in mouse.c HOT 3
- How to stop moveMouseSmooth?
- i hope one day u implement Image search HOT 1
- Returned image buffer has Red and Blue channels swapped [b, g, r, a] HOT 1
- mouseMove 960, 540 does not move to center of screen 1920x1080 HOT 2
- How to make screen of visible window on macos? HOT 2
- git clone npm i why error HOT 1
- All key events continuously hold down keys on Windows only. HOT 1
- Does not work on windows 11 HOT 1
- Using the typeString() method does not let you find the name of a file.
- Installing for nw.js - "A dynamic link library (DLL) initialization routine failed."
- Robotjs doesn't work with Electron, current time 2023.11.27 HOT 3
- or
- In the multi-instance tool, RobotJS is not working. There are no issues with reading properties, but moving the mouse or pressing the keyboard is not functioning correctly.
- Is there anyway to use this library in Nextjs app
- I cannot install robotjs HOT 5
- UTF-8 client type string HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotjs.