Emulate Keyboard

I want to use a node to emulate keystrokes to type on a windows host remotely. I can send a payload with the text I want to type, but I haven't had any luck finding a node that works which can type out this payload.

I've tried nbr-keyb-mouse, node-red-contrib-sendkeys and looked at a few more and none of them seem to work.

Has anyone else been successful at doing this? Is there some other program I can interact with using node-red to emulate a keyboard?

Hi welcome to the forum.

I can't help with sending key strokes but maybe if you say what you are trying to achieve (the end goal) we could suggest an alternative solution?

You could always call out to PowerShell. But I've had better luck with using AutoHotKey.

I have a FlexBar and use that with AHK to make Windows interactions easier. I also use AHK to define some global hotkeys.

Alternatively, there are various node.js packages that you could use with a function node.

For example: GitHub - Krombik/keysender: Node.js Desktop Automation for Windows.

I want to be able to respond to in-game messages. There's not way to interact in this game except through keyboard / mouse gestures so there's no API to communicating in-game.

Currently I am using a node to cat the log file, which shows me the message I receive.

However, I cannot reply without using the keyboard or some keyboard emulator.

edit:

I am receiving these messages via node-red to home assistant. And I can also send a payload with my message back, also using home assistant. But no way to interact with the game. Either way, I am not against using some other solution, but I do need to be able to do it from my android phone.

Also to make it clear, I am not a programmer and am not really good at this. I can use node-red because I find it easier to program with, so ideally it would have a GUI front end.

II checked out keysendder node.js and it's not easy to me to see how I can use it from my android device to send a message. I'm afraid I'm not that technical.

Perhaps I can integrate with autohotkey from my android device? I'll do a bit of googling for that.

Hmm, you aren't making it easy for yourself I'm afraid. Check out Tasker for Android. AHK is about as easy as these things get I'm afraid.

Not had time to check any of this but in case it helps: