Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Do 23.03.06 07:25 
Hi,

hat jemand eine Complete Liste mit den ganzen Key codes? Ich finde nähmlich keine Codes für , ; . : _ - ' # ä ö ü + * ~ | > < .
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 23.03.06 07:54 
Vk-Codes für diese Sonderzeichen gibt es meiner Meinung nicht. Aber die Funktion Chr(IntValue : Integer ) : AnsiChar; sollte dir weiterhelfen.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Do 23.03.06 07:59 
ich danke dir, aber wie soll ich das machen?
ich möchte wenn mein Programm läuft und ich auf Komma drücke, dann soll etwas passieren
das bei FormKeyDown auslösst, ich danke dir schonmal 8)
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 23.03.06 08:38 
ausblenden Delphi-Quelltext
1:
if Chr(Key)=',' then ...					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Do 23.03.06 08:43 
genau das habe ich gemacht, aber nur die sonderzeichen gehen net mit Chr(Key), gibt es vieleicht noch eine andere lösung?
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Do 23.03.06 09:03 
entweder

ausblenden Delphi-Quelltext
1:
if key = 188// rausgekriegt mit showmessage(inttostr(key));					


oder
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
function GetCharFromVKey(vkey: Word): string;
var
  keystate: TKeyboardState;
  retcode: Integer;
begin
  Win32Check(GetKeyboardState(keystate));
  SetLength(Result, 2);
  retcode := ToAscii(vkey,
    MapVirtualKey(vkey, 0),
    keystate, @Result[1],
    0);
  case retcode of
    0: Result := ''// no character
    1: SetLength(Result, 1);
    2:;
    else
      Result := ''// retcode < 0 indicates a dead key
  end;
end;

....

if GetCharFromVKey(key) = ',' then ....

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.