Skip to content

stephaneAG/serialToWebsockets

Repository files navigation

serialToWebsockets

Little repo hosting some tool(s) to ease debug & development

switching between xdotool & websockets

Later on, a switch could be provided to either output to xdotool or websockets https://brewinstall.org/Install-xdotool-on-Mac-with-Brew/

installing the necessary modules & stuff

  • sudo npm cache clean -f
  • sudo npm install socketio
  • sudo npm install serialport

to digg if needed

API

once the server is started with javascript nodejs ./app.js, use either cli or Espruino board connected over serial & send data in the following format to forward it to client as inputs

cli supported commands

ws:{"wsmouse.send":[20,20,0,0]} // to send mouse events ( wsmouse.send:[x,y,btn,wheel]} )
ws:{"wskeyboard.tap":[0,5]} // to send keyboard events ( wskeyboard.tap:[modifiers,key] )

cli xdotool commands

xdotool click 1
xdotool mousemove 500 500
xdotool keydown Pointer_Button1
xdotool mousemove_relative 0 100
xdotool keyup Pointer_Button1

Espruino commands

// WSMouse
wsmouse.send( [x,y,btn,wheel] )
// WSKeyboard
wskeyboard.setModifiers(modifiers, callback)
wskeyboard.tap = (key, callback)
wskeyboard.type(txt, callback)

// for the USBKeyboard2 module
kb.htype(txt, callback)

About

Little repo hosting some tool(s) to ease debug & development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published