You can input dynamics with the keyboard by using the dynamics popover, and with the mouse by using the Dynamics panel. When using the dynamics popover, you can input whole dynamic phrases containing immediate and gradual dynamics simultaneously, such as p<f>p.
You can also input dynamic points that affect playback, but do not appear in the music, in the Dynamics editor.