Skip to content

Add mouse & keyboard support to xcloud gaming platform using virtual gamepad emulation layer.

Notifications You must be signed in to change notification settings

nathan130200/xcloud-emul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add mouse & keyboard support to xcloud gaming platform using virtual gamepad emulation layer. .NET Core Desktop

About

The main objective of this software is to provide mouse & keyboard support for xcloud using an emulation layer directly through a virtual gamepad.

It will not be necessary to install any extensions in chrome. I personally did this because there were other plugins/extensions that did the same but in a poorly optimized way or didn't work correctly with what I wanted. So I decided to implement this from scratch.

Requeriments

Old Source Code

Current source code is my initial work of emulation layer test, i've created a hard-coded preset for Atomic Hearts

Where buttons:

  • D0 (Aka Number 0 in alpha keys not numpad keys): Stop and close application (your cursor gets released again)
  • D1 (aka Number 1 in alpha keys) - Switch Prev Weapon
  • D2 (aka Number 1 in alpha keys) - Switch Next Weapon
  • Up, Left, Right, Bottom arrow keys - Apply respective directions i D-PAD keys.
  • WASD - Move character
  • Mouse - Move aim (ajust ingame sensibility to maxium, i used this to achive better results in this prototype)
  • Space - Jump (A button in xbox)
  • R - Reload Weapon / Open Weapon menu / Consume item (While in inventory) (X button in xbox)
  • Q - Use shock (Y button in xbox)
  • C - Crouch (B button in xbox)
  • LMB (aka Left Mouse Button) - Fire (emulate Right Trigger pressed)
  • RMB (aka Right Mouse Button) - Precise Aim - (emulate Left Trigger pressed)
  • M (View button in Xbox) open Map
  • P (Menu button in Xbox) pause game.
  • F (RB button in Xbox) used in atomic to collect items/interact with things.

Notes

  • Sice ViGEm Bus Driver is a windows kernel mode driver also we are using win32 p/invoking functions, so we can only run on windows. If you find some multiplatform way to do this you can submit an PR, make an fork or notify us.

  • Tested also transport input data using websockets, but the huge delay between pasing/(de)serializing data tooks a huge time and the result was a very bad experience.

  • Once emulation is running, your mouse will be forced to stay on center of your screen! This can cause a light increase in CPU usage so instead i just decided to add an Delay between each mouse calls to prevent high CPU usage.

Special Thanks

  • ViGEm Team to provide this amazing library for managing usb virtual gamepad devices

  • ChatGPT to help me understand some calculations in mouse delta movement.

Remarks (Current Version)

Aka: Things that i'm working on in a future version

  • I've uploaded an early version of emulator while i was testing, so i've used an predefined and hard-coded preset for Atomic Hearts. You can change this preset by editing the source code but now i'm working in a revamped version to implement an GUI (this reason .NET Desktop Runtime is required in future update) with customizable presets and keybindings configurator.

  • I've also ajusted by default update rate of input to 16ms. This means the thread will update controller buttons, values, triggers and D-Pad at 60hz. This was enough for me in my internal tests with atomic hearts at max sensitivity in game settings (aim looks nice, moving too. Major problem still in aim, i will test some other win32 apis later).

  • I (in next version) will implement each input in separated threads such as LEFT/RIGHT Axis both in different threads this also include buttons. DPad keys, etc. For better performance and less latency.

  • Be patient, i'm working on this in my free time, but i'm trying to do my best!

About

Add mouse & keyboard support to xcloud gaming platform using virtual gamepad emulation layer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages