SFML community forums

Bindings - other languages => DotNet => Topic started by: Pikablu on December 07, 2013, 12:24:07 am

Title: Problem with mouse + keyboard input
Post by: Pikablu on December 07, 2013, 12:24:07 am
Hey everyone,

I've been playing around with the .net binding for a while now, and I've come into a small problem with handling keyboard and mouse input at the same time. In what I've tried, whenever I type something and click on the window at the same time with the left mouse button, the click is ignored until I stop typing. However, typing and clicking with any other button will handle the clicks properly.

Here's an example which has the same effect (using sfml 2.1):

 
        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML_App", Styles.Titlebar);

            window.MouseButtonPressed += window_MouseButtonPressed;

            while (window.IsOpen()) {
                window.DispatchEvents();
            }
        }

        static void window_MouseButtonPressed(object sender, MouseButtonEventArgs e) {
            Console.WriteLine("Clicked: " + System.Environment.TickCount);
        }
 

Any ideas?
Title: Re: Problem with mouse + keyboard input
Post by: Epiplon on December 07, 2013, 03:28:23 am
Worked fine for me. When any mouse button is clicked, the message is print on the console.
Title: Re: Problem with mouse + keyboard input
Post by: Pikablu on December 07, 2013, 06:58:12 am
Strange, I tried this on a few computers and it was the same on each one...

This is what I do:

1) Click on the screen. It registers the click properly
2) Start typing random letters non-stop
3) Left click on the screen while still typing... it doesn't register the click
4) Right click on the screen while still typing, everything works fine
5) Stop typing, then I need to double click with the left mouse button before it displays the message again