Autor Beitrag
Fabian E.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mi 06.09.06 18:36 
Hab grad en Problem bei Pong: Ich fange die Tastendrücke mit aSyncKeyState ab aber wenn ich eine taste gedrückt halte dann ruckt der schläger zuerst, macht ne halbe sekunde nix und bewegt sich dann flüssig. Hab überahupt kein plan warum. Hab jetz leider kein code hier, der folgt aber noch. vllt ist das problem ja bekannt und ihr könnt mir auch so schon helfen.
Danke schon mal!
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Mi 06.09.06 18:45 
Am einfachsten nimmst du die OnKeyDown/OnKeyUp-Ereignisse, um den Status einer Taste abzufragen.
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mi 06.09.06 18:48 
Ist schon klar aber dann kannst du immer nur eine Taste abfragen und nicht zwei was bei zwei spielern schon sinnvoll ist! ;-) oder geht das auch? Aber ich glaub nicht.
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: Mi 06.09.06 19:00 
benutze: "GetAsyncKeyState"

bsp:
ausblenden Delphi-Quelltext
1:
if GetAsyncKeyState(vk_left) < 0 then // taste gedrückt!					
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mi 06.09.06 20:36 
Jo thx hat funktioniert aber ich hab noch das problem dass der mir die tasten w und s nich erkennt! hab nach geguckt nach den virtual keys und auch schön brav eingesetzt aber bei s und w und den anderen buchstaben wollte er nicht so richtig. also überall da wo ich zahlen eingesetzt hab. bei bezeichnungen wie "vk_left" und so war das kein problem! was kann ich da machen?
danke!
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: Do 07.09.06 15:46 
achte darauf das du den Keycode der Großbuchstaben einstetzt!

ausblenden Delphi-Quelltext
1:
if GetAsyncKeyState(ord('W')) < 0 then // geht!!!					

ausblenden Delphi-Quelltext
1:
if GetAsyncKeyState(ord('w')) < 0 then // geht nicht!!!