Jump to content

Mouse button detection


StOneDOes
 Share

Go to solution Solved by Josh,

Recommended Posts

After performing a double click, at not necessarily very fast intervals, the Window::MouseDown() function does no longer detect the mouse properly.

I tested with 2 different mouses to be sure. Minimum required to reproduce:

EDIT: I left a critical part out - hold the right mouse button down after the second click and it remains saying OUT for me, as though it doesn't think I'm still holding the button down.

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    //Get the displays
    auto displays = GetDisplays();

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        std::cout << ( window->MouseDown( MOUSE_RIGHT ) || window->MouseHit( MOUSE_RIGHT ) ? "IN" : "OUT" ) << std::endl;
    }

    return 0;
}

 

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...