2024-09-22 Godotメモ「InputEventMouseButtonで押されてるマウスのボタンを判別する」 Godot 自分用メモ。 v4.2.1.stable event.button_index で取得できる。 1が左クリック、2が右クリック、3が中クリック、4が上スクロール、といった具合。 数字自体はMouseButtonのEnumに定義があるので、 if event.is_pressed() and event.button_index == MOUSE_BUTTON_LEFT: pass で良さげ。 というか、地味にv3系からEnumの定義が変わったっぽい。 参考: docs.godotengine.org docs.godotengine.org docs.godotengine.org