Ribot: you question can be parsed in more than one way, so I'm not sure if I understand it correctly. If I understand the question correctly, your problem is that you're worried that the fire button might have been pressed and released between calls to getKeyStates.
But the JavaDocs for that method state that the button's bit will be set if the key is currently down or has been pressed at least once since the last time this method was called
. So you won't miss any short clicks.
Unless you're targeting a particular phone for which it's true, you shouldn't assume that the fire button is (only) button 5. E.g. in Nokia Series 60 phones both button 5 and clicking the joystick work as fire buttons. Except (as usual) the 3650, where 5 probably isn't a fire button - the 3650 isn't a MIDP 2.0 phone, but still it's a good reminder that sensible assumptions aren't always true
. I guess also in the MIDP 2.0 Nokia 6822, 5 isn't a fire button when the folding alphanumeric keyboard is open (haven't checked). These complications are why MIDP has abstract game actions as well as key codes.