Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 229
    • Issues 229
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus Games
  • solarussolarus
  • Issues
  • #513
Closed
Open
Created May 22, 2014 by Christopho@christophoOwner

Input gets queued/buffered and causes the player to not stop when analog stick is released

Created by: xethm55

After upgrading to the new solarus 1.2, I noticed that when playing the character moves after releasing the analog stick on my gamepad - it worked fine in 1.1.

After some digging I found that only one event is handled per game cycle. Per the integration guide of SDL 2, you need to handle all events every cycle. I modifed the following function in MainLoop.cpp

/**
 * \brief Detects whether there was an input event and if yes, handles it.
 */
void MainLoop::check_input() {
  InputEvent* event = InputEvent::get_event();
  while(event != NULL){
    notify_input(*event);
    delete event;
    event = InputEvent::get_event();
  }
}

This resolved the issue for me and I can again continue my ZSDX adventures.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking