You need to import KeyEvent package which is android.view.KeyEvent
... import android.view.KeyEvent;
Everytime you use a class which comes from a different package of java (java.lang
is the default) you should add import
to say to the compiler where it should take the class. Eclipse/IntelliJ IDEA/Netbeans help you to import packages by using a simple key combination so use one of them if you can.
For error 3: Your return is out of the method body!
If you want to learn more about android dev, read this.