Go to the BP_Chat and then create a new variable called PreviousHUDInputMode and set its type to Boolean.
Then create a new function called UpdateHUDInputMode and copy the image below.

Next copy the video below,
Lastly add the highlighted nodes shown below, location at the top of the screenshot.
