Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Man0Sand

Pages: [1]
1
Hm, judging from you mentioning the future developer, did you perhaps interpret that I'm suggesting to elaborate on the comments in the implementation file, https://github.com/SFML/SFML/blob/master/src/SFML/Window/Unix/InputImpl.cpp ? Because that actually wasn't my idea, but rather to hint the user of SFML that sf::Mouse::isButtonPressed won't work for the extra buttons in Linux. So I think that comment would go right into the mouse header, https://github.com/SFML/SFML/blob/master/include/SFML/Window/Mouse.hpp.

2
Hello!
Since this is my first post here, let me briefly introduce myself. For living I develop software for electric drives, which in software point of view are predominantly real-time embedded devices. Programming is also a hobby of mine, and my journey with SFML began a couple of years ago when my co-worker persuaded me to participate in an open university C++ course. Besides the usual programming exercises there was a project, and we ended up making a game using SFML, which was suggested for making games and similar programs. And since then I've been writing small programs and games with SFML.

I'm using SFML 2.5.1 on Ubuntu 18.04. I've got a Logitech G Pro Wireless gaming mouse which has side buttons. I noticed that the side button presses and releases can be polled using sf::Event just fine, but polling their states in real time doesn't work: Mouse::isButtonPressed(Mouse::XButton1); and Mouse::isButtonPressed(Mouse::XButton2); always return false. For other buttons real time polling works without problems.

The Linux version of InputImpl::isMouseButtonPressed implementation (https://github.com/SFML/SFML/blob/master/src/SFML/Window/Unix/InputImpl.cpp) suggests that XButton1 and XButton2 aren't supported by XLib. I spent a while with Google and it seems the XLib function (XQueryPointer) used to poll the real time data in Linux supports buttons 1 to 5, and some sources state that in Linux buttons 1-3 are the normal buttons and buttons 4-5 are actually the wheel scrolls to up and down direction.

So even though the problem seems to be in Linux instead of SFML, I think it'd be helpful to mention this in SFML documentation somewhere, since at least I was a bit surprised by this. It could save somebody's time if this information is available for example in public headers instead of the source code files. I didn't quite know where to put this kind of suggestion so I chose general discussion.

Man0Sand

Pages: [1]
anything