Delphi Call Winapi:getkeyboardtype

Source: Internet
Author: User

Statement:

GetKeyboardType(
 nTypeFlag: Integer {0:键盘类型; 1:键盘子类型; 2:功能键数量}
): 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 keyboards');
 List.Add('Nokia 9140 and similar keyboards');
 List.Add('Japanese keyboard');
 i := GetKeyboardType(0);
 ShowMessage(List[i-1]);  {我这里返回: IBM enhanced (101/102-key) keyboard}
 i := GetKeyboardType(1);
 ShowMessage(IntToStr(i)); {这是厂商自定义数据, 这里返回: 0}
 i := GetKeyboardType(2);
 ShowMessage(IntToStr(i)); {返回: 12; 就是指 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.