sidorares / node-rfb2

rfb wire protocol client and server
MIT License
139 stars 27 forks source link

Server-side mouse events #29

Open ayunami2000 opened 3 years ago

ayunami2000 commented 3 years ago

I want to implement pointer lock using the server-side mouse location events, is this possible? (or just ability to move mouse relative to where it is)

sidorares commented 3 years ago

probably not possible right now, can you point me to a documentation on this?

ayunami2000 commented 3 years ago

https://yingtongli.me/blog/2019/11/18/input-over-ssh.html

"QEMU has an extension to the VNC protocol (RFB) for relative mouse movement, but this is not supported by other servers. RealVNC, too, has its own extension for relative pointer motion, but no free software implements this (see, e.g. TigerVNC issue #619)."

I am using this for QEMU so their relative mouse movement extension will work for my purposes.

https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#777qemu-pointer-motion-change-pseudo-encoding

sidorares commented 3 years ago

should be easy to add

which os are you running? Can you document a simple qemu setup to test this feature? ( installation, start parameters, which guest applications to start that can demo pointer lock )

ayunami2000 commented 3 years ago

This is what I am currently using:

D:/qemu/qemu-system-x86_64.exe -L D:/qemu -accel hax -vnc :0 -device intel-hda -device hda-output -hda D:/Documents/cvm/emulator/hda.img -m 3072 -net nic,model=e1000 -net user -rtc base=localtime,clock=host -smp cores=4,threads=4 -usbdevice tablet -vga vmware

the key items here are -vnc :0 and POSSIBLY (but probably not) -usbdevice tablet

it is running tiny7 (windows 7 tiny installation) and I am running windows. (ideally this update to node-rfb2 should work on any platform)

guest applications that would need pointer lock are minecraft and other games like that such as roblox or vrchat.

EDIT: After looking at the page I linked, it would be really cool if you could also implement qemu's RFB audio. I have also been trying to get audio without a virtual audio cable and this seems like it would do just that. (but idk if this is too much to ask, lmk)

EDIT 2: You probably didn't need this, but I have time to kill so here is the list of encodings including QEMU's: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#encodings

ayunami2000 commented 3 years ago

I'm sorry if you are busy, but if you are and won't be able to work on this please let me know. If that is the case I will make an attempt to implement these features myself but don't want to fork the repository just for it to be updated by you.

sidorares commented 3 years ago

very unlikely that I'll have time to work on this in the near future but happy to guide you and review PRs

ayunami2000 commented 3 years ago

I'm gonna be honest I have no idea what I am doing. This is what I've done so far: https://github.com/ayunami2000/node-rfb2

But I'm not sure what to put for what links back to clientMsgTypes (I just put 1 which isn't even defined in clientMsgTypes) and even then I'm not sure if I am doing everything right. In short, I'd like some guidance.