gimmevents icon indicating copy to clipboard operation
gimmevents copied to clipboard

Simple event tunnel for sending keyboard and mouse events from one browser to another

gimmevents

by @michalbe

WHAT?

Gimmevents is a simple event tunnel that sends keyboard and mouse events from one browser to another. CLients needs to register with a unique key.

WHY?

I don't have any VR controller what makes my a-frame based games boring and non-interactive. With Gimmevents I can render game on my VR set (for now it's just my phone) and still control it with my computer's keyboard or mouse.

HOW?

Gimmevents uses WebSockets and custom pairing system to send events from one browser to another.

Keyboard events

gimmevents-keyboard.gif

Mouse events

gimmevents-mouse.gif

API

Emitter

const gimmevents = new Gimmevents.Emitter({
	key: my_unique_session_key,
	host: host
});

gimmevents.register(event);

Receiver

const gimmevents = new Gimmevents.Receiver({
	key: my_unique_session_key,
	host: host
});

gimmevents.on(event, (e) => {
 // Do stuff
});

EVENTS

  • keyup
  • keydown
  • keypress
  • mousemove
  • mouseup
  • mousedown

Development

git clone [email protected]:michalbe/gimmevents.git
cd gimmevents
npm i
npm run dev

then open localhost:7100/emitter.html in one browser and localhost:7100/receiver.html in another. Demo listened to all the keys pressed in one window and sends them to another.