Comments (5)
I am still interested in my question, though I want to notice that I solved my problem by binding a part of another library in my project. I integrated SFML\Window\Joystick.hpp that only uses these static functions to work without initialization:
// Is joystick #0 connected?
bool connected = sf::Joystick::isConnected(0);
// How many buttons does joystick #0 support?
unsigned int buttons = sf::Joystick::getButtonCount(0);
// Does joystick #0 define a X axis?
bool hasX = sf::Joystick::hasAxis(0, sf::Joystick::X);
// Is button #2 pressed on joystick #0?
bool pressed = sf::Joystick::isButtonPressed(0, 2);
// What's the current position of the Y axis on joystick #0?
float position = sf::Joystick::getAxisPosition(0, sf::Joystick::Y);
I don't want to be ungrateful. I am sure your library is on a good way. This may be interesting for other users who are looking for input libraries.
from gainput.
Sorry for the slow response time. I hope you are still interested in some insight into this.
I guess you are on Windows?
Conceptually, joysticks are considered gamepads. They should work on most platforms. On Windows, however, Gainput currently only uses XINPUT for acquiring gamepad data. XINPUT is Microsoft's only current library for this and it only really supports Xbox gamepads. So, as long as your joystick does not show up as an Xbox gamepad, you are out of luck for now.
I'm getting the impression that it might make sense to add support for the deprecated DirectInput API or maybe the joystick API.
from gainput.
Thx got it! Yes, this would extend your library nicely. It is hard to find a lightweight, easy, purely HID oriented library without all the graphics, sound modules etc.!
from gainput.
I'm also very interested in using gainput for AIrSim project. We basically connect remote controls used for drones to PC via USB. They show up as joystick and we want to access this input. I just tried out gainput to access this and as mentioned in this thread, it doesn't recognize joysticks at all.
I think current way to do this is using Raw Input APIs (instead of DirectInput APIs). There just doesn't seem to be good cross platform library that allows access to joysticks without lot of fuss. It would be very nice to have this capability in gainput!
from gainput.
Hi, just tried to read USB Joypad input with current sources (3/2/2019) but no response in Gainput test projects.
from gainput.
Related Issues (20)
- [iOS] Issue with touch pressure + Fix
- integrate with SFML HOT 2
- Can't differentiate multiple gamepad inputs on macOS
- Ignore last mouse event
- Error while compiling HOT 1
- Raw input not working HOT 4
- cannot link library HOT 1
- Unresolved externals (VS 2019) HOT 1
- OSX + CreateMouseDevice fails
- Couple of pads not detected HOT 1
- I cannot get this thing to work HOT 7
- display image in xdisplay
- Link time error while using as a library on windows HOT 1
- Not support Xbox one Gamepad BOOL button HOT 1
- Windows Gamepad LeftTrigger & RightTrigger events cause IsValidButton() to return false
- scrolling the mouse sometimes causes issues.
- How to get callbacks even when bool keys are repeating while holding down?
- Unsupported? HOT 1
- Cannot specify link libraries for target "gainput" which is not built by this project. HOT 1
- Library does not support Linux
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gainput.