Middle Click produces no event #231

Closed
opened 2026-01-29 02:42:33 +00:00 by john · 1 comment
Owner

MouseButton.MIDDLE should exist and be generated

`MouseButton.MIDDLE` should exist and be generated
Author
Owner

Fixed in the current session. Changes made:

  1. PyScene.cpp: Added registration for middle mouse button:

    registerAction(ActionCode::MOUSEBUTTON + sf::Mouse::Middle, "middle");
    
  2. PyScene.cpp: Updated doAction() to handle "middle" button events:

    if (name.compare("left") == 0 || name.compare("right") == 0 || name.compare("middle") == 0 || ...)
    
  3. PyScene.cpp and PyCallable.cpp: Updated button string-to-enum conversion to handle "middle":

    else if (strcmp(button, "middle") == 0) button_val = 2;
    

Middle click events now produce MouseButton.MIDDLE in the on_click callback.

Fixed in the current session. Changes made: 1. **PyScene.cpp**: Added registration for middle mouse button: ```cpp registerAction(ActionCode::MOUSEBUTTON + sf::Mouse::Middle, "middle"); ``` 2. **PyScene.cpp**: Updated `doAction()` to handle "middle" button events: ```cpp if (name.compare("left") == 0 || name.compare("right") == 0 || name.compare("middle") == 0 || ...) ``` 3. **PyScene.cpp** and **PyCallable.cpp**: Updated button string-to-enum conversion to handle "middle": ```cpp else if (strcmp(button, "middle") == 0) button_val = 2; ``` Middle click events now produce `MouseButton.MIDDLE` in the on_click callback.
john closed this issue 2026-01-29 04:22:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#231
No description provided.