Implement key functions

- works for key down and key up
- some small changes
Supports fullscreen functionality