Recording Key Presses into an Array

any1 can point me on a good and less cpu consuming way to do this?

thanx in advance

ChromeD