Autor Beitrag
chrisdrury
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

WinXP
D5 Prof
BeitragVerfasst: Do 29.12.05 08:53 
Hallo,
ich möchte gern in einem SynEdit die Eingabe des $-Zeichens (also shift + 4) abfangen.
Folgender Code funktioniert aber nicht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TEditForm.SynEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (Key = 4) and (Shift = [ssShift]) then
  begin
    ShowMessage('taste $ gedrückt');
    ...
    Key := 0;
  end;
end;

Es wird aber noch nicht mal die Message angezeigt.
Hab es auch schon mit Ord(4) versucht.
Nun habe ich 2 Fragen:
Ist der Wert für key falsch, und wenn, welcher ist der Richtige?
In SynEdit gibt es sogenannte "keystrokes", dort ist die
Kombination shift + 4 bereits vorbelegt, kann es evtl. daran liegen?
chrisdrury Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

WinXP
D5 Prof
BeitragVerfasst: Do 29.12.05 10:23 
Problem gelöst:
Es muss heißen Key = Ord('4').