Yes, the boolean array is ok, but one thing you have to watch out for might be presses that are to quick to catch.
During my mobile dev days I did a similar approach and had this problem.
The problems happens when you store the key presses/releases and then in the main loop, poll the array. By the next iteration, they key once pressed might have been unpressed.
The alternative is to store presses and releases in different arrays. Then after each processing in the main loop, untoggle the pressed by checking if it had been released.
i.e.
1
| if ( keyreleased[i] ) keypressed[i] = keyreleased[i] false; |
This way you can even catch those quick presses.
Also, and this is why it was a problem with mobiles, some phones did not support repeats and some would not register a release if you were pressing two keys at once.
(posted this out of memory, I hope it is not failing me!)