Many thanks. I speciically referred to 'keys'. That is, on screen 'soft key' instead of hard physical keys. The number of key I stated is generally that a 'machine' need. Bank ATM, weighting scale and may be some industrial control machine. A few keys to select "one of out several" menu jump to next screen level. Up/Down arrow to trim parameters, says temperature controller.
A few row is easily done with IR emitted and sensor. Yes, you can have high resolution sensor. Say, use an traditional (the original wide spread use version, 30 years ago, Rockwell modem inside. Not the advanced higher resolution G3 version that did not got wide deployment) fax machine 'contact' (direct touching document, no lens) linear 1-D CCD sensor is about 100 dot per inch if my memory is correct.