I'm refactoring some javascript to use jQuery and one of the events looks something like this

```
document.onkeyup = function keyUp(e) {

if (e.keyCode == 70) { // 'f'
    //Do something
}
else if (e.keyCode == 78) { // 'n'
    //Do something else
} ...

```

Unfortunately the things done in the cases aren't as similar or as simple as those in [this question](https://stackoverflow.com/questions/3640843/refactoring-a-large-block-of-chained-if-else-statements). Is there a better way to write this instead of a massive hard-coded if/else or switch/case statement?