Feeding data to xidi externally #76
joao678
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
This is a really cool idea, thanks so much for sharing it! The SDL part itself is already quite interesting. Thinking even beyond that, it is entirely conceivable that one of Xidi's future modular back-ends could be an IPC back-end so that any type of external application could provide Xidi with physical controller data. Anyone could write their own application or script and Xidi would take the data as physical controller input, which could then get piped to the application via DirectInput. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As previously discussed in #74, I've made an attempt at replacing xinput with SDL2 to allow for more controllers (or anything really) to feed data to xidi, but concerns were raised about the possibility of using SDL2 since SDL2 uses DirectInput calls itself that HookModule already uses.
I can show another solution to this problem, this time allowing pretty much any external program to feed data to xidi without making it load SDL2 or any other dependency
Here's the branch: https://github.com/joao678/Xidi/tree/json
How it works: Xidi reads a memory mapped file written by another program and it fills the virtual controller state with the data recieved. On the xidi side cJSON is used (it's just two files), xidi recieves a json from another program for example, a python script that reads a sdl controller
in this other example a HTML file with a canvas is created that sends data to a websocket server with python, I can open this page on my phone from the local network and send the commands from my phone to xidi for example
This approach decouples SDL from xidi and allows it to work as intended, with the added option of reading data externally
Beta Was this translation helpful? Give feedback.
All reactions