Winapi: getkeyboardtype-get the keyboard type information

Source: Internet
Author: User
// 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;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.