was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

42 Visitors Online


 
...Informationen über die aktuelle Tastatur erhalten?
Autor: Thomas Stutz
[ Tip ausdrucken ]  

Tip Bewertung (6):  
     




// The GetKeyboardType function retrieves information about the current keyboard.

function KeyBoardType: string;
begin
  case 
GetKeyboardType(0) of
    
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'
      else 
        
Result := 'Unrecognized keyboard type';
  end;
end;

function KeyBoardSubype: Integer;
begin
  
Result := GetKeyboardType(1);
end;

function NumberOfFunctionKeys: string;
begin
  case 
GetKeyboardType(3) of
    
1: Result := '20';
    2: Result := '12/18';
    3: Result := '10';
    4: Result := '12';
    5: Result := '10';
    6: Result := '24';
    7: Result := 'Hardware dependent'
      else 
        
Result := 'N/A';
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  
label1.Caption := Format('Keyboard Type: %s', [KeyBoardType]);
  Label2.Caption := Format('Keyboard Subtype: %d', [KeyBoardSubype]);
  Label3.Caption := Format('Keyboard Subtype: %s', [NumberOfFunctionKeys]);
end;

 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners