What i’m trying to do is to make a button, that when clicked allows the user to draw a bezier curve in the viewport just like in edit mode, and once it’s done, to be able to use that curve inside my script.
By “once it’s done” i mean when the user presses another button or hits enter.
As I said if there is a way to avoid writing custom code, is feasible to create a curve object and edit it as normal. Another option is to use the Flexibezier addon that has very handy and advance bezier editing.