Calculated keyboard height based on screen size and keyboard origin to detect if a hardware keyboard is present.

This reverts commit d1ba2d97c3eabe519bf1009a4da8ac5ff3793e67.