Given two fields named Input and Output:

1.Typing Text or Morse Code into field Input should result in the the corresponding result in field Output.

So :
Text in field Input = Morse Code in field Output.
Morse Code in field Input = Text in field Output.

2.The conversion should take place as each letter or entity is typed into field Input.

3.Mixing Text and Morse Code in field Input is NOT permitted and your solution should allow input to field Input to be ignored if mixing is detected.

Special consideration needs to be given to periods (.), hyphens (-) and spaces ( ).

International Morse Code table below as reference.

Morse Code