Cant get mouse in the editor canvas

Ive tried all the functions in editor plugIn and none of them can check were the mouse is.

Is there a way to do what those 2 funcs are doing, but having them returning a true or false ? So i can check if the editor is inside canvas in a node that doesnt have “extends EditorPlugin”… ?

you can use get_mouse_position(), this will give you mouse position with canvas transform applied, as for checking if the mouse is actually inside the canvas (not in the inspector for ex) i haven’t found a way

EditorInterface.get_editor_viewport_2d().get_mouse_position() 

edited

i found a way to check if the mouse is inside the editor’s canvas:

EditorInterface.get_editor_viewport_2d().get_parent().get_parent_control().get_global_rect().has_point(event.position)

where event.position is the screen mouse position.