This Python program emulates the functionality of a Sony PS4 Dualshock controller using a computer mouse and keyboard. It allows users to control games or applications that support gamepad input by translating mouse movements, keyboard presses, and mouse clicks into corresponding gamepad inputs.
- Mouse Emulation: The program translates mouse movements into joystick movements, allowing users to control the right analog stick of the virtual gamepad.
- Keyboard Emulation: Keyboard keys are mapped to various buttons on the virtual gamepad, providing control over different functions.
- Mouse Button Emulation: Mouse clicks are translated into button presses on the virtual gamepad, enabling actions like aiming and shooting in games.
- Directional Pad Emulation: Certain keyboard keys are mapped to directional pad buttons, allowing navigation and menu selection.
- Customizable Sensitivity: Users can adjust the sensitivity of mouse movements and keyboard inputs to suit their preferences.
- Mouse Movements: Control the right analog stick.
- Left Mouse Button: Aim (emulates left trigger button).
- Right Mouse Button: Shoot (emulates right trigger button).
- Scroll Wheel Up: Move up (emulates up arrow button).
- Tab: Move down (emulates down arrow button).
- B: Move left (emulates left arrow button).
- 4: Move right (emulates right arrow button).
- Q: Left shoulder button.
- E: Right shoulder button.
- X: Combo of left and right shoulder buttons.
- F: Square button.
- R: Square button.
- Spacebar: Cross button.
- 1, 2, 3, G: Triangle button.
- C: Circle button.
- V: Right thumbstick button.
- Python 3: The program requires Python 3 to run.
- vgamepad: Python library for creating virtual gamepads.
- tkinter: Python library for creating GUI applications.
- Install Python 3 on your system.
- Install the required dependencies using
pip install vgamepad
. - Run the Python script.
- Launch the program.
- Use the mouse to control the right analog stick.
- Use keyboard keys to trigger button presses.
- Left-click to aim, right-click to shoot.
- Scroll up for additional actions, such as moving up.
- Use other mapped keys for various functions.
- This is a basic implementation and not yet finalized. Further improvements and features can be added for enhanced functionality.
- Ensure that the program window has focus while using keyboard and mouse inputs for emulation.
- Adjust sensitivity settings in the script according to your preferences.
- The program is designed for Windows but may work on other platforms with appropriate adjustments.