Unable to connect to iMac from MacBook Pro

Hello,

 

I have Macbook Pro and IMac  when I try to connect from the Macbook to the Imac the connection is made succesfully but at the logon screen for the Imac no keyboard input is recognised? I hae checked all settings ans that both systems are runnig the latest version of Teamviewer. I CAN connect from the Imac to the Macbook pro but not in reverse. Mabook is running High sierra (it cannot take Mojave) Imac is runnig Mojave. Any help appreciated.

 

Many thanks