-5

I want to explore about the signal of buttons from my gamepad, it's old but can use. And i want to code a small program that can detect and display the 'code' of these buttons when I touch to them in C++, can any body help me, I don't know where can I start ? Please !!!

iamatsundere181
  • 1,401
  • 1
  • 16
  • 38

1 Answers1

2

To put it shortly, if you want to make a game playable in the command line, then don't. It's not meant for that kind of purpose.

I would personally suggest the SFML library. It has utilities for drawing on a window, handling events, graphics, sound, etc. and it's also pretty simple. Here is what you are (probably) looking for: sf::Joystick class

However, if you don't want to use any external library, you will have to rely on your OS's library (e.g windows.h on windows) but that would make the code non portable, and most people hate that, since C/C++ were created specifically for that purpose. So this method is generally not suggested.

En3
  • 21
  • 2