Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
koen1711 authored Dec 3, 2024
2 parents 708f052 + c143ca4 commit 299405e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions play/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ def _handle_mouse_loop():
####################################
# @mouse.when_clicked callbacks
####################################
if callback_manager.get_callbacks(CallbackType.WHEN_CLICKED) is not None:
if (
click_happened_this_frame
and callback_manager.get_callbacks(CallbackType.WHEN_CLICKED) is not None
):
for callback in callback_manager.get_callbacks(CallbackType.WHEN_CLICKED):
run_callback(
callback,
Expand All @@ -163,7 +166,10 @@ def _handle_mouse_loop():
########################################
# @mouse.when_click_released callbacks
########################################
if callback_manager.get_callbacks(CallbackType.WHEN_CLICK_RELEASED) is not None:
if (
click_release_happened_this_frame
and callback_manager.get_callbacks(CallbackType.WHEN_CLICK_RELEASED) is not None
):
for callback in callback_manager.get_callbacks(
CallbackType.WHEN_CLICK_RELEASED
):
Expand Down

0 comments on commit 299405e

Please sign in to comment.