// Declaration: getkeyboardtype (ntypeflag: INTEGER {0: keyboard type; 1: keyboard subtype; 2: Number of function keys}): integer; // example: Procedure tform1.formcreate (Sender: tobject); var I: integer; List: tstringlist; begin list: = tstringlist. create; List. add ('ibm PC/XT or compatible (83-key) keyboard'); list. add ('olivetti "ICO" (102-key) keyboard'); list. add ('ibm PC/AT (84-key) or similar keyboard'); list. add ('ibm enhanced (101/102-key) keyboard'); list. add ('nokia 1050 and similar keyboard'); list. add ('nokia 9140 and similar keyboard'); list. add ('Japanese keyboard'); I: = getkeyboardtype (0); showmessage (list [I-1]); {Here I return: IBM enhanced (101/102-key) keyboard} I: = getkeyboardtype (1); showmessage (inttostr (I); {This is the vendor-defined data. Return: 0} I: = getkeyboardtype (2 ); showmessage (inttostr (I); {return value: 12; indicates F1 .. f12} List. free; end;