I'm not fully understanding what you are trying to do. Are you want to set up a system that stores which keys are pressed and which ones are not, then the remaining program will access that system to determine if a particular key is pressed or not?
If so, you will want to have your program "hook into" the key system, so that it can poll a key's state. For example, a sprite class would have a reference to the key system (or just the keys it's interested in), then it will query the reference for the key's current state. Similar to the ActionListeners in Swing.
Let me know if that's what you're looking for.