Creating new joystick / input device

I’m attempting to use a stationary bike and a game controller (probably Xbox) as the input mechanism for games - picture Mario Kart, but you pedal a stationary bike to move forward. I have the signal from the pedal, would like to combine that with the signal from the controller (for turning and other buttons) and present that as an input device for SDL2 such that it can control, for example, supertuxkart and emulated N64 games.

I’m primarily on Linux and OS X but ideally would support other platforms.

Can anyone point me in the right direction for how to create this? I’m completely new to SDL, rusty but ok in C/C++, decent with Python.

Greetings …

I would suggest possible try building a USB or BlueTooth (BLE) HID Joystick/GamePad, at least that is what I am doing. Could also emulate a keyboard or joystick and map their input inside your application.

Hope that helps.