I solve the problem using xdotool and mapping the rosegarden buttons to the buttons in my own window. I can give the python script (which use xdotool and tkinter).