We do this on focus and on blur events of text field. We call a function on hub that broadcast a simple message about user to all clients like typing=true with id set to connection id from context. Then in client this highlights the user with underline or different colour to see user is busy typing something. In our app multiple users can type but you get the concept.
You need 3 things basically
- Client side method to update server when someone starts typing. This is similar to send method in examples on wiki
- Server then broadcast to all or selected clients with who is writing or has started typing. You can even send the keycode to mimimc same on other clients
- Client side method to handle the broadcast about who is writing
We use it on focus and raise a flag so we dont send too many requests to server but you can optimise it in various ways.