i'm a little rusty wrt facts at my fingertips, but broadly speaking (i'm using "you" to mean program author, but that entails sometimes being a program's victim):
when you want a program to get everything the keyboard sends (which means the program will have to handle everything the keyboard sends), your program needs to put your tty into "raw-mode". If you want the operating system to handle things like backspace or left-arrow to correct typos, instead of putting it into raw mode, your program just leaves it with the default in what-came-to-be-called "cooked mode"; cooked mode generally means a line will be sent at a time after ENTER, instead of char by char as keys are pressed (note, this is not the same as half and full duplex, though it is related).
Programs can be linked to use readline to read, while the rest of the program can be written as if the tty is in cooked mode; readline will handle the raw mode. Upon receiving characters typed and an ENT, readline will send cooked lines
If your program is getting char by char in raw mode, you need to realize that some keys don't send single chars, they send a series of chars, generally an "escape sequence", both because the sequence needs to be escaped, and also because the sequences escape with the ESC key-char.
you can get into weird modes where the ESC chars get swallowed but the rest of the key-chars pass through. That's what you are seeing when you see letters get typed but not interpreted as arrow key movements. if your keyboard is persistently screwed up, you can use stty to reset it, or if you are really fancy, set it the way your non-functioning program expects it to be set.