I use library from https://github.com/MHeironimus/ArduinoJoystickLibrary, as well as Keyboard library. This controller can play games on Steam and Tetri.io by pressing specific buttons to change modes.
Default mode is gamepad(using Joystick library), but you can switch to Keyboard mode to play tetr.io by pressing button 9 & 10 together. As for to switch back, press button 14 & 15 together.
The python program is for the use of playing Brawl Stars on BlueStacks(Using Steam desktop setting). It can limit the mouse, so the mouse can only move in a circle.
Here is a video of using it: https://www.youtube.com/watch?v=uxKchEFA-Cg&ab_channel=Kelsier%E5%87%B1%E8%A5%BF%E7%88%BE
in the video, the first clip is Milk Choco, using Steam gamepad setup; the second clip is Brawl Stars on Bluestacks, using Steam desktop setup and Python program; the third clip is Tetr.io on the browsers, using Arduino keyboard library.