Skip to main content

SDL2 mouse motion event keeps occuringoccurring

The code I'm using is like so:

SDL_Event e;
SDL_PollEvent(&e);
switch (e.type)
{
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse, the SDL_MOUSEMOTION event keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

SDL2 mouse motion event keeps occuring

The code I'm using is like so:

SDL_Event e;
SDL_PollEvent(&e);
switch (e.type)
{
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse the SDL_MOUSEMOTION event keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

SDL2 mouse motion event keeps occurring

The code I'm using is like so:

SDL_Event e;
SDL_PollEvent(&e);
switch (e.type)
{
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse, the SDL_MOUSEMOTION event keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

Tweeted twitter.com/StackGameDev/status/1127317600864800768

The code I'm using is like so:

SDL_Event e;
    SDL_PollEvent(&e);
    switch (e.type)
    {
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse the SDL_MOUSEMOTION evenSDL_MOUSEMOTION event keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

The code I'm using is like so:

SDL_Event e;
    SDL_PollEvent(&e);
    switch (e.type)
    {
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse the SDL_MOUSEMOTION even keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

The code I'm using is like so:

SDL_Event e;
SDL_PollEvent(&e);
switch (e.type)
{
    case SDL_MOUSEMOTION:
    {
        YCam += e.motion.yrel; 
    }
    break;
}

When I run the program, nothing happens, however, once I first move the mouse the SDL_MOUSEMOTION event keeps firing and the mouse keeps moving. This occurs even when I've stopped moving my mouse. Pressing any key including mouse keys stops the movement.

This seems to be a purely technical problem unrelated to game design.
Link
Philipp
  • 123.2k
  • 28
  • 264
  • 345
Source Link
Loading