Autor Beitrag
JaketheSnake
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 07.11.05 21:09 
Hallo ertma

Wie kann man die klicks der maus zählen ?

Programier nämlich grad ein Program/Spiel bei dem man nach z.B. fünf klicks nachladen muss hab aber leider keine Ahnung wie ich die zählen soll ?

_________________
Good, better , best
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Mo 07.11.05 21:20 
jeder klick wird doch eine Aktion auslöse oder?
kannst du da nicht einfach eine variable einbauen die dann runtergzählz wird und wenn sie 0 ist muss nachgeladen werden?

_________________
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.
- Neil Armstrong
JaketheSnake Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 07.11.05 21:25 
sorry kannste mir ma ein ganz kurzen code geben ?

_________________
Good, better , best
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 07.11.05 21:31 
Etwas selber nachdenken bitte:
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:
24:
25:
26:
27:
28:
29:
30:
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    ClickCount: Integer;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Inc(ClickCount);
  if ClickCount = 5 then
    ShowMessage('Nachladen');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ClickCount := 0;
end;
JaketheSnake Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 07.11.05 21:33 
Danke :D , hab aber selber nachgedacht sieht aber ihrgendwie extrem falsch aus :?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var  I : Integer ;
begin
      if button = mbleft then
      I := 7;
      I - 1;

end;

end.

_________________
Good, better , best
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 07.11.05 21:39 
Ich empfehle hier an dieser Stzelle besser mal den Suche in: Delphi-Forum, Delphi-Library CRASHKURS sonst gibt das nichts. Insbesondere mach dich mal über die Lebensdauer von lokalen und globalen Variablen schlau und wie man Variablen Werte zu weist.
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Mi 11.01.06 19:33 
Also wenn du net nur im Prog fragen willst machst du
ausblenden Delphi-Quelltext
1:
if get AsyncKeyState(1) then inc(i);					

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.