Corrected source comment.
Fixed implicit function declarations by including the missing header.
Removed unused local variable to fix warning.
Changed function to be static.

The function keycode_to_SDL() is only used in this file.
Changed function to return -1 through SDL_Error() instead of plain -1.
Added a new unused key code from Android 4.4 (API 19).
Moved two function calls so they are only called if needed.

If the MotionEvent is not from joystick the return values are not needed.
Changed motion listener implementation not to inherit from Activity class.