When sending keypresses to MAME there needs to be a delay or it may not register. The delay suggested by the code I found was 50ms, but I don't want to just apply that across the board. For now that is how it's set up, but it should be made optional on a per-button basis eventually.