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

Author Topic: Problem with mouse + keyboard input  (Read 3063 times)

0 Members and 1 Guest are viewing this topic.

Pikablu

  • Newbie
  • *
  • Posts: 5
    • View Profile
Problem with mouse + keyboard input
« 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?
« Last Edit: December 07, 2013, 12:28:01 am by Pikablu »

Epiplon

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Problem with mouse + keyboard input
« Reply #1 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.

Pikablu

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem with mouse + keyboard input
« Reply #2 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

 

anything