Comments (10)
robot.typeString('!@#$%^&*()')
returns 1234567890
on windows, probably related.
from robotjs.
There's always a way! Thanks for bringing this to my attention. I'll look into it when I get some time.
from robotjs.
I looked into this for a few minutes and I believe the issue is in keypress.c. I'm curious if this is an issue on Windows though. I'll update when I have more time to test.
from robotjs.
Uh oh! That's silly.
from robotjs.
I will check this out on windows when I have the time.
from robotjs.
The Windows issue mentioned by @nikersify was fixed in #110.
from robotjs.
https://github.com/octalmage/robotjs/blob/master/src/keypress.c#L224 typeString prints one byte at a time; probably that's a utf8 string & any characters outside of ascii take more than one byte; it needs to handle this.
I'd love to get this fixed, but I don't know enough C to send a good pull request. I'm sure I could hack together something bad that works, though - would that help?
from robotjs.
Same problems here!
Let's try to explain it better. Let me point out that all the problems, bugs or whatever have been tested on Windows 10.
The exact problem reported from @nikersify is not present anymore. Point is that maybe the fix didn't include the keyTap function. In fact if I execute robot.keyTap('!'); it prints "1", it should be very easy, I think that the same fix used for typeString must be used over keyTap.
I would fix it by myself and submit a PR if I only be good in C... but the functions seem a bit complex to me so I trust in you 😄 @octalmage
Then skipping to the acceented words, there is a strange and inconsistent behavior between typeString and keyTap. Both of them don't work, but if I write robot.typeString('à'); and execute the script, it does nothing (it doesn't print "à" nor an error) but if I write robot.keyTap('à'); and execute, I get this:
robot.keyTap('�'); // That is an unknown char for the console and it's marked by an empty square
^
Error: Invalid key code specified.
at Error (native)
at Object.<anonymous> (C:\Users\test.js:5:7)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:445:3
from robotjs.
Hi,
is sending Chinese character related to this issue? Chinese character doesn't work with robot.typeString
on my Windows 10 machine.
I notice that keypress.c
is using keybd_event
to simulate keypress.
However, I have stumbled upon a question on stackoverflow about sending unicode with c++ on Windows.
It seems to suggest that sendInput
should be used instead of keybd_event
for sending unicode.
from robotjs.
Same bug on Linux
from robotjs.
Related Issues (20)
- How to make screen of visible window on macos? HOT 2
- git clone npm i why error HOT 2
- 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 7
- UTF-8 client type string HOT 1
- Focused program does not react to keyup event
- Mouse is not moving when using Remote Desktop Connection with Windows HOT 1
- Badges on README.md are broken
- Error, Help! HOT 1
- When using typeString() to output consecutive identical unicode characters, only the first character will be output
- I'm reading the documentation thoroughly. It does not capture mouse click?
- Electron combined with robotjs on Win10 and Win11 systems: scrollMouse method does not work HOT 3
- keyTap('right_alt') actually send left alt instead of right alt
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.