add pin, refactor keyboard height calculation