And they were right. You need 'a' before 'keyboard' for the same reason you need it (and used it, too) before 'typewriter'. You must use 'a/an' before a countable noun in the singular number, when it's the first time you speak about something of which there are more than one and while it is still unknown which particular object you are referring to. Once we know which particular object we mean, we refer to it using 'the'.
In other words, you will almost always have to use 'a/an' before any one countable noun in the singular before it has become known. There are only a few cases when a singular countable noun can be used without an article before it, and these are mainly proverbial, as in "Put pen to paper". Also, you must not use 'the' before either countable nouns in the plural or uncountable nouns if they are still unspecified (not defined, not known yet). That's why you should not say 'the data' in your sentence: we don't mean any particular set of data that we know of, we mean any data that we may ever need to enter. We don't know what these are going to be, do we?
So, your sentences should read:
1- A keyboard looks like a typewriter. (All keyboards/any keyboard...)
2- A keyboard is an input device used for entering data (any data) into the computer.