30-04-2008, 12:15 AM
إليك هذا الكود الذي تستطيع أن تتعرف به على خصائص لوحة المفاتيح
لكن أحسن أن تبحث على SDK الذي ذكره الأخ عزيز.
فإن لم يكن لديه SDK فلدي فكرة سنقوم بتجريبها.
كود :
[B]function [/B]KeyBoardType: [B]string[/B];
[B]begin
case [/B]GetKeyboardType(0) [B]of
[/B]1: Result := 'IBM PC/XT or compatible (83-key) keyboard';
2: Result := 'Olivetti "ICO" (102-key) keyboard';
3: Result := 'IBM PC/AT (84-key) or similar keyboard';
4: Result := 'IBM enhanced or compatible';
5: Result := 'Nokia 1050 and similar keyboards';
6: Result := 'Nokia 9140 and similar keyboards';
7: Result := 'Japanese keyboard'
[B]else
[/B]Result := 'Unrecognized keyboard type';
[B]end[/B];
[B]end[/B];
[B]function [/B]KeyBoardSubype: Integer;
[B]begin
[/B]Result := GetKeyboardType(1);
[B]end[/B];
[B]function [/B]NumberOfFunctionKeys: [B]string[/B];
[B]begin
case [/B]GetKeyboardType(3) [B]of
[/B]1: Result := '20';
2: Result := '12/18';
3: Result := '10';
4: Result := '12';
5: Result := '10';
6: Result := '24';
7: Result := 'Hardware dependent'
[B]else
[/B]Result := 'N/A';
[B]end[/B];
[B]end[/B];
[B]procedure [/B]TForm1.Button1Click(Sender: TObject);
[B]begin
[/B]label1.Caption := Format('Keyboard Type: %s', [KeyBoardType]);
Label2.Caption := Format('Keyboard Subtype: %d', [KeyBoardSubype]);
Label3.Caption := Format('Keyboard Subtype: %s', [NumberOfFunctionKeys]);
[B]end[/B]فإن لم يكن لديه SDK فلدي فكرة سنقوم بتجريبها.
من تشبه بقوم فهو منهم

