Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys using opto-electronic means