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 - XenoZergNid

Pages: [1]
1
Window / Re: Input bug when holding shift?
« on: January 10, 2016, 10:03:54 pm »
@victorlevasseur

Thank you very much. It works beautifully.

I'm knew to these forums so just tell me if I'm supposed to close it somehow.

2
Window / Re: Input bug when holding shift?
« on: January 10, 2016, 06:36:37 am »
@Hapax

ADown becomes true when I press A, then continues to be true while holding shift then still remains true after A is released and still doesn't change after a release the shift key.

Is it possible that it could be something wrong with my system? I haven't had any problems with input anywhere else.

I used the following command: g++ -std=c++14 -g3 ./main.cpp -o ./test -lsfml-graphics -lsfml-window -lsfml-system

3
Window / Input bug when holding shift?
« on: January 09, 2016, 08:30:27 pm »
I created a program to demonstrate my problem below. To replicate hold down A, then hold down shift. Release A, then release shift. The program now prints that A is held down even though A was released. One can do the same with D.

#include <SFML/Graphics.hpp>
#include <iostream>


int main()
{
        // Create the main window
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");


        bool ADown = false;
        bool DDown = false;

        // Start the game loop
        while (window.isOpen())
        {
                // Process events
                sf::Event event;
                while (window.pollEvent(event))
                {
                        // Close window: exit
                        if (event.type == sf::Event::Closed)
                                window.close();

       
                        if (event.type == sf::Event::KeyPressed) {
                                if(event.key.code == sf::Keyboard::Key::A)
                                        ADown = true;
                                else if(event.key.code == sf::Keyboard::Key::D)
                                        DDown = true;
                        }
                        else if (event.type == sf::Event::KeyReleased) {
                                if(event.key.code == sf::Keyboard::Key::A)
                                        ADown = false;
                                else if(event.key.code == sf::Keyboard::Key::D)
                                        DDown = false;
                        }
                }

                std::cout << "A: " << ADown << ", D: " << DDown << "\n";


                // Clear screen
                window.clear();


                // Update the window
                window.display();
        }





        return EXIT_SUCCESS;
}
 

I run archlinux and sfml 2.3.2
Thanks in advance.

Pages: [1]