replaced deprecated enums and fixed keyboard rotation geometry calculations