Originally Posted by
5Five555
That depends on how you named your sound files.
If you named each sound the same as the keyCode of the key that it's assigned to then you can use getDefinitionByName to create the sound just by the keyCode of the key that is pressed.
If you named the sounds differently than above, then you'll probably need an array of every sound and an array of every keyCode. When a key is pressed you find the index in the keyCode array of the pressed key then use that index to find the appropriate sound.