After restarting my Mac it suddenly worked. So I guess using sudo + input monitoring permissions on IDE and terminal works fine :)