Code using the MIDP1.0 implementation on my Nokia 3650 can track multiple key-presses by keeping track of keyPressed() and keyReleased() call-backs:
Press key 1: keyPressed(key1) is called
(only key 1 is pressed)
Press key 2: keyPressed(key2) is called
(both key 1 and key 2 are pressed now)
Release key 1: keyReleased(key1)
(only key 2 is pressed)
This is my question: Which Series40/Series60 phones have the same behaviour?
I can not test it on the SDKs, since keypresses can only be done by using the computer's mouse on the emulators... and i have only one.. :-)
I need this functionality for an app that uses the pound-key as a kind-of 'SHIFT' key-modifier.
It's not what device, but what firmware. I had a 3510i that didn't support multiple keypresses (v.3.xx, I can't remember exactly), and then I changed it to one with a newer firmware (v.4.44) and it did support multiple keypresses.
Yeah, that's the coding alright, but some firmware versions of some phones won't fire the second keyPressed() if a key is already pressed. In that case there's really not much you can do, no matter how you code it.
If you write a game that depends on something like that to work properly, then you'll be losing many users with the older phones. You have to code defensively.
A good example of that defensive coding is MotoGP. There is an option in the settings menu to have automatic breaking and accelerating. Without that option playing on a phone that doesn't support multiple keypresses is almost impossible, since you won't be able to accelerate/break and turn at the same time. Another example are many shooters where there is an autofire option, again, with the same logic that on older phones you won't be able to shoot and move simultaneously without it.
I'll design the MIDlet to be able to use both, with a setting to provide an alternative not to use it. The user-interface will be a bit more 'awkward' without the ability to use double key presses but still functional.