Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Printing UTF-8 Characters with accents #16
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?
Same problems here!
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.
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
is sending Chinese character related to this issue? Chinese character doesn't work with
I notice that
However, I have stumbled upon a question on stackoverflow about sending unicode with c++ on Windows.
It seems to suggest that