Question: This should be straight foreward, but I simply can't figure it out(!)

I have a UIView 'filled with' a UIScrollView. Inside the scrollView I wan't to have a UITableView.

I have hooked up both the scrollView and the tableView with IBOutlet's in IB and set the ViewController to be the delegate and datasource of the tableView.

What else do I need to do ? Or what shouldn't I have done?

Answer: 
Personally, I would define the key-states as disjoint states and write a simple state-machine, thus:

```
enum keystate
{
    inactive,
    firstPress,
    active
};

keystate keystates[256];

Class::CalculateKeyStates()
{
    for (int i = 0; i < 256; ++i)
    {
        keystate &k = keystates[i];

        switch (k)
        {
        inactive:
            k = (isDown(i)) ? firstPress : inactive;
            break;
        firstPress:
            k = (isDown(i)) ? active : inactive;
            break;
        active:
            k = (isDown(i)) ? active : inactive;
            break;
        }
    }
}

```

This is easier to extend, and easier to read if it gets any more complex.
You are always setting `IsFirstPress` if the key is down, which might not be what you want.