Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Spiel blockiert SendKey und andere virtuelle Eingaben (https://www.delphipraxis.net/98002-spiel-blockiert-sendkey-und-andere-virtuelle-eingaben.html)

Circle 20. Aug 2007 15:08


Spiel blockiert SendKey und andere virtuelle Eingaben
 
Hi Leute

Ich hab echt ein komisches Problem. Ich hab nen Code geschrieben der einem Spiel gewisse Tasten sendet, ich mach also sozusagen ein Macro. Aber das funktioniert irgendwie nicht.
Ich habs mit SendKey, keybd_event und postmessage versucht, aber keines funktioniert. Wenn ich zum Test z.B. Notepad öffne, dann wird das Makro schön ausgeführt, alle Zahlen werden geschrieben. Aber beim Spiel geschieht nichts, es scheint das ganze zu blockieren. Nur frag ich mich, wie ist das möglich. Wie kann ein Spiel das drücken einer Taste blockieren? Kann man das irgendwie umgehen, weil mir scheint das unlogisch :D

iGoA 20. Aug 2007 15:31

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Vielleicht ist das ein Anti-Cheater-Schutz? ;-)

Circle 20. Aug 2007 16:13

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Ja, aber z.B. die Bildschirmtastatur die funktioniert ja auch und das ist ja auch nur ne virtuelle Tastatur oder.

iGoA 20. Aug 2007 16:34

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Sorry, kann Dir nicht helfen. Das mit dem cheaten is mir nur sofort in den Kopf gekommen.

Robert Marquardt 20. Aug 2007 17:02

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Mach mal eine Pause zwischen Key Down und Key Up wenn du mit keybd_event sendest.

Circle 20. Aug 2007 18:30

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Hab mal ne sleep-funktion eingesetzt aber funktioniert auch ned. Versteh ich echt ned. Ist aber nen komischer Cheat-Schutz ^^
Welche Befehle nutzt denn die normale Bildschirmtastatur von Windows? Die kann ja nicht wsa spezielles haben.

Dani 20. Aug 2007 18:42

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Um welches Spiel geht es denn? Vieleicht brauchst du eine speziell auf das Spiel zugeschnittene DLL...

Timi-loader 20. Aug 2007 21:58

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
hast du die tasten auchnoch zusätzlich gemappt? so:

down:
Code:
keybd_event(taste, MapvirtualKey(taste, 0), 0, 0);
up:
Code:
keybd_event(taste, MapvirtualKey(taste, 0), KEYEVENTF_KEYUP, 0);
mfg

Circle 24. Aug 2007 16:36

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
danke, aber funktioniert auch nicht. ist aber egal, ich mach jetzt nen umweg über die bildschirmtastatur ^^ lass ichs halt dort klicken :D

TKC 24. Aug 2007 16:45

Re: Spiel blockiert SendKey und andere virtuelle Eingaben
 
Also die Bildschirmtastatur machts mit SendInput

Zitat:

SendInput Function

--------------------------------------------------------------------------------

The SendInput function synthesizes keystrokes, mouse motions, and button clicks.

Syntax

UINT SendInput( UINT nInputs,
LPINPUT pInputs,
int cbSize
);
Parameters

nInputs[in] Specifies the number of structures in the pInputs array.

pInputs[in] Pointer to an array of INPUT structures. Each structure represents an event to be inserted into
the keyboard or mouse input stream.

cbSize[in] Specifies the size, in bytes, of an INPUT structure. If cbSize is not the size of an INPUT structure,
the function will fail.


Return Value

The function returns the number of events that it successfully inserted into the keyboard or mouse input stream.
If the function returns zero, the input was already blocked by another thread.

To get extended error information, call GetLastError.


Remarks

The SendInput function inserts the events in the INPUT structures serially into the keyboard or mouse input stream.
These events aren't interspersed with other keyboard or mouse input events inserted either by the user
(with the keyboard or mouse) or by calls to keybd_event, mouse_event, or other calls to SendInput.

This function does not reset the keyboard's current state. Any keys that are already pressed when the
function is called might interfere with the events that this function generates. To avoid this problem,
check the keyboard's state with the GetAsyncKeyState function and correct as necessary.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:34 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz