If a user has access to your physical machine (or just to the OS remotely) they can intercept data between the keypress and app sending it, you are correct that any encryption is less effective in that case. What Signal and other apps like it are good at, is making sure nobody can read it when it's sent between your computer and another. If your computer is not compromised, as far as we know any message sent with Signal is secure.