Support X button events again
Do this by duplicating the current code and porting it to use X again. A better approach would involve our own event structures, and I really don't want to do that right now. We can clean this up later.
Showing with 430 additions and 29 deletions