The best open source alternative to JoyToKey is AntimicroX, which is both free and Open Source. If that doesn't suit you, our users have ranked more than 10 alternatives to JoyToKey and four of them is open source so hopefully you can find a suitable replacement. Other interesting open source alternatives to JoyToKey are Gaming Keyboard Splitter (Free, Open Source), Xiaomi Gamepad to Xbox 360 controller Mapper (Free, Open Source) and xboxdrv (Free, Open Source).
This is a Xbox/Xbox360 gamepad driver for Linux that works in userspace. It is an alternative to the xpad kernel driver and has support for Xbox1 gamepads, Xbox360 USB gamepads and Xbox360 wireless gamepads, both first and third party.