If you want to create a commodity you should read the section about commodities in the RKRM. Will be quite complicated without.
If the program shall run on OS1.3 as well, you cannot use commodities, you then have to add an input handler to input.device. Again, read the section about input handlers in the RKRM or it will become a little bit complicated.
Bye,
Thomas