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 !!!
Asked
Active
Viewed 735 times
-5
-
2C++ said nothing about gamepad, the easiest way is call OS's function. Change the question to narrow down the scope. – Non-maskable Interrupt Aug 17 '14 at 05:57
-
Can you help me instead of minusing my points ? – iamatsundere181 Aug 17 '14 at 06:01
-
you can use C++ as the programming language but you need to use the controllers API which is usually pretty simple, and in all seriousness you don't need to call OS functions if its only a cmd or terminal you need. – daniel Aug 17 '14 at 06:02
-
also tell me what controller your using and what os your using it on, also do you want your program to be a window or cmd, whats you target with all of this ?, these questions will help get your question answered. – daniel Aug 17 '14 at 06:06
-
It would be nice to tell your OS? – Mohit Jain Aug 17 '14 at 06:09
-
@MohitJain i asked him the same question like five minuets ago i don't think he is going to answere. – daniel Aug 17 '14 at 06:11
-
I am using Windows 8.1 – iamatsundere181 Aug 17 '14 at 08:30
1 Answers
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