<body> class when keyboard open

Hi all,
is there any example / solution how to globally control if the keyboard is open and if is open add class to html tag?

Thanks