Keyboard works but mouse does not

The iPhone does not have the Mouse feature available by default. To turn it on, on the iPhone go to:

Settings | Accessibility | Touch | Assistive Touch

And turn on Assistive Touch. You will now see a mouse cursor on the iPhone and will be able to control it.