made x11 event sending more flexible