Keyboard input

hi,
this is my current code

if(String.fromCharCode(e.keyCode) == 'R') {

what i need is where the R is to pass in a var

i tried

if(String.fromCharCode(e.keyCode) == (words[letterDrop])) {

where letterDrop is a number

any ideas