Set mouse to center and interact with ui

Setting the cursor to locked centers the mouse, but prevents it from interacting with ui, is there anyway I can center the mouse and make it interact with world space ui at the same time?