Autor Beitrag
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Di 28.02.06 19:13 
Hi Leute also ich hab mal versucht was mit einfachen mitteln zu proggen was die Maus invertiert:

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:
procedure TForm1.FormCreate(Sender: TObject);
var cursorpos: TPoint;
begin
  getCursorpos(cursorpos);
  altx := cursorpos.X;                    // X-Wert zum Vergleichen
  Timer1.Interval := 1;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var cursorpos: TPoint;
begin
  getCursorpos(cursorpos);
  neux := cursorpos.X;                    // neuer X-Wert
  if neux > altx then begin
  diff := neux - altx;
  diff := 2*diff;       // die Differenz wird verdoppelt sonst würde der Mauszeiger ja immer auf einer posi bleiben
  SetCursorPos(altx - diff, CursorPos.Y); // neue Cursor-Position
  end;
  if neux < altx then begin
  diff := altx - neux;
  diff := 2*diff;       // die Differenz wird verdoppelt sonst würde der Mauszeiger ja immer auf einer posi bleiben
  SetCursorPos(altx + diff, CursorPos.Y); // neue Cursor-Position
  end;
  altx := cursorpos.X;                    // neuer Wert zum vergleichen
end;


Naja und wenn ich das ausprobier klappts *he,he* nich so ganz ^^ wie ich mir des vorgestellt hab.
Ich find mein Fehler nich, könnt ihr mir helfen?

dÄnX

_________________
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.
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: Di 28.02.06 20:10 
so gehts, hab die procedure glei mal ein bissel verkürzt :wink:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Timer1Timer(Sender: TObject);
var cursorpos: TPoint;
begin
  getCursorpos(cursorpos);
  neux := cursorpos.X;
  diff := neux - altx;
  SetCursorPos(altx - diff, CursorPos.Y);
  getCursorpos(cursorpos);//um ein neuen Wert zu vergleichen zu haben musst du deine variable auch updaten :D
  altx := cursorpos.X;
end;


an dem markierten lag es das es bei dir nich gefunzt hatte...

_________________
GEIZ IST GEIL! - Ihr Sozialamt
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Di 28.02.06 22:28 
Ah danke vielmals

_________________
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.
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Di 28.02.06 22:38 
hm also das klappt jetzt allerdings nur innem total kleinen Bereich am Bildschirm rand.
???

_________________
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.
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: Mi 01.03.06 17:24 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Timer1Timer(Sender: TObject);  
var cursorpos: TPoint;
begin
  getCursorpos(cursorpos);
  neux := cursorpos.X;
  diff := neux - altx;
  SetCursorPos(altx - diff, CursorPos.Y);
  getCursorpos(cursorpos);//um ein neuen Wert zu vergleichen zu haben musst du deine variable auch updaten :D  
  altx := cursorpos.X;
  if altx=0 then altx:=1;//sollte maus am linken rand stehen setz sie ein pixel nach rechts 
  if altx=screen.Width-1 then altx:=screen.width-2;//sollte die maus aum rechten rand stehen setze sie ein pixel nach links
end;


folgendes Problem vorher:

war man am Bildschirmrand konnte man die maus nich mehr vom rand weg bekommen...

Beispiel:
-Maus am linken Rand
-um nach rechts zu kommen muss man zeiger erst mal nach links bewegen
-links ist aber das bild zuende
-d.h. keine Cursor Änderung
-procedure greift nich mehr
-maus bleibt am rand hängen

mit dem code oben funzt es bei mir....

_________________
GEIZ IST GEIL! - Ihr Sozialamt
Darth Sitthiander
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 95



BeitragVerfasst: Mi 01.03.06 17:42 
Wenn ich das richtig verstehe versuchst du die maustasten zu vertauschen oder?:
hier
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure SwapMouseButtons(const ASwap: Boolean);
begin
  if ASwap then
    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,1, Nil, 0)
  else
    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,0, Nil, 0);
end;


Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 01.03.06 19:06 
user profile iconDarth Sitthiander hat folgendes geschrieben:
Wenn ich das richtig verstehe versuchst du die maustasten zu vertauschen oder?:
hier
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure SwapMouseButtons(const ASwap: Boolean);
begin
  if ASwap then
    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,1, Nil, 0)
  else
    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,0, Nil, 0);
end;


Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt

nein du verstehst es nicht richtig ^^
Darth Sitthiander
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 95



BeitragVerfasst: Mi 01.03.06 19:26 
Ok schuldigung(sry für spamm).
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Do 02.03.06 13:48 
hm also starsurfers Beitrag hat schon geholfen aber wie gesagt des funzt nur in nem Bereich von ca. 300 Pixeln.
Eigentlich müsste des alles so passen ich kapier nich was da ez noch falsch is.

_________________
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.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 04.03.06 01:18 
Bei mir funktioniert starsurfers Source einwandfrei.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 04.03.06 08:31 
jo, vielleicht solltest du mal die maus in die andere richtung bewegen, dann kommst du auch weiter :P