keyboard must match for 2 cycles and joystick must match for 2 cycles (2 loops of state machine). This seems to pretty much prevent false keypresses. Of course cannot type when stick moved...
Small adjustment to reduce false keypresses. They still occur though. Need a better algorithm.
Switched to using Peters chameleon_io module. Great, gives c64 joystick and cdtv support!