Script for easier area split/join, help needed


I’m trying to do my first Simple Operator script. What I want to achieve is faster area split/join’s. I’m on a wacom and the split handler (in the corners) are to pesky to click (99% of the times I move the 3d cursor instead of splitting)

So what I want to achieve is, split the view with a shortcut. and possible join it also by pressing shortcut then move cursor in the direction you want to join.


makes the area split with the default args, of HORIZONTAL and 0.5 , so it splits the current context in half.

but what I can’t figure out is how to get mouse_x and mouse_y positions. so I can compare that with the current context width or height, to get a value between 0.0 and 1.0 to split at.



I found the mouse_x and mouse_y events, also mouse_prev_x and mouse_prev_y

that’s awesome! if I could compare mouse_x with mouse_prev_x, I can get direction and use that for area_join()

but I am stuck, anyone that knows blender’s py api for screen interaction could you please help out a bit.