Just a simple Python script that uses pygame and requests to let you control a Dahua PTZ camera with a regular joystick. I've tested this on the Dahua SD1A404XB-GNR and Dahua SD49425XB-HNR cameras but it should theoretically also work on HikVision and Amcrest cameras.
Before running the script install the requirements
pip install -r requirements.txt
Then edit the variables in the script and launch it
python dahua_joystick.py