Skip to content

MacOS: fixes is_mouse_button_pressed randomly requiring 1 or 2 clicks#545

Merged
not-fl3 merged 1 commit intonot-fl3:masterfrom
birhburh:macos_click_fix
Apr 14, 2025
Merged

MacOS: fixes is_mouse_button_pressed randomly requiring 1 or 2 clicks#545
not-fl3 merged 1 commit intonot-fl3:masterfrom
birhburh:macos_click_fix

Conversation

@birhburh
Copy link
Contributor

@birhburh birhburh commented Apr 14, 2025

Based on @pherrymason suggestion in #422

fixes #422
fixes #524
Probably makes #448 not needed anymore also

Updated reproducible example from #524:

use std::thread;
use std::time::Duration;

use macroquad::prelude::*;
use macroquad::ui::root_ui;

#[macroquad::main("Buttons")]
async fn main() {
    thread::sleep(Duration::from_secs(2));
    loop {
        root_ui().label(None, "hello megaui");
        if root_ui().button(None, "Push me") {
            println!("pushed");
        }
        next_frame().await;
    }
}

Before:

Screen.Recording.2025-04-14.at.16.03.21.mov

After:

Screen.Recording.2025-04-14.at.16.05.45.mov

Based on @pherrymason suggestion in not-fl3#422

#fixes 422
#fixes 524
Probably makes not-fl3#448 not needed anymore also
@not-fl3
Copy link
Owner

not-fl3 commented Apr 14, 2025

Thanks for PR!

@not-fl3 not-fl3 merged commit 350cb91 into not-fl3:master Apr 14, 2025
11 checks passed
@MasterThomas15
Copy link

Ive got this problem in 2025 again..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buttons take multiple presses for them to activate. is_mouse_button_pressed randomly requires 1 or 2 clicks

3 participants

Comments