Autor Beitrag
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Do 30.03.06 11:23 
Hi,
ich hab folgende 2 Probleme.

1. Prob:
Wenn ich nach dem Programmstart die Image bewegen
lasse, dann flackert der Inhalt, kann man das
verhindern ?

2. Prob:
Wenn ich eine Taste drücke, dann merkt der erst
nach ca. 1 sekunde das ich die gedrückt halte.
Kann man das jetzt so machen, das der solange
die Taste gedrückt ist das der da das Signal für
schickt ohne diese Pause am Anfang, das macht sich
nämlich bei Spielen nicht so gut :D!

Wäre toll wenn ihr mir mal wieder helfen könntet!
MfG Bergmann89.
Ramon
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 107

WIN7
D6 Prof, D7 Prof, D 2009
BeitragVerfasst: Do 30.03.06 11:39 
Zitat:
1. Prob:
Wenn ich nach dem Programmstart die Image bewegen
lasse, dann flackert der Inhalt, kann man das
verhindern ?

Versuch mal:
Form1.DoubleBuffered := True;

Zeig am besten mal den Code, wie du denn Tastendruck abfängst.

Gruß
Ramon 8)
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 30.03.06 11:49 
GetKeyState + F1 sollte Deine Tastaturprobleme beheben!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Fr 31.03.06 08:02 
Also ich hab das ma Probiert, das mit der Image geht ! :)
Und das mit den Tasten das geht noch nicht. Ich hab das
Prog ma mit hochgeladen ! Da könnt ihr dann sehen, dass das
kein Spaß macht wenn man wie wild auf den tasten rumhacken
muss damit das teil hochfliegt, oder es dauert zu lange.

Könnt es euch ja man ankuken.
MfG Bergmann89.

P.S.: Hoch und Runter mit den Arrowkeys.
Einloggen, um Attachments anzusehen!
ub60
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 765
Erhaltene Danke: 130



BeitragVerfasst: So 02.04.06 22:53 
Für die Tastatur habe ich keinen Tipp, dafür aber was anderes:
Wenn Du die Bilder als BMP speicherst und den schwarzen Hintergrund einfarbig machst und außerdem Transparent auf True setzt, dann hat Dein Raumschiff keinen schwarzen Hintergrundrahmen.
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Mo 03.04.06 11:42 
OK, das werd ich ma noch machen.
Das hat mich auch immer genervt :D

THX & MfG Bergmann89.
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Di 04.04.06 19:40 
Also, das flacken hab ich ja jetzt weg bekommen !
aber das mit den Tasten geht noch nicht, denn das
GetKeyState + F1 geht bei mir irgendwie nicht.
Ich kann auch nicht 2 Tasten gleichzeitig drücken,
da wird die die Zuerst gedrückt wurde oder gedrückt
halten wurde ignoriert bzw. unterbrochen !

kann mir da keiner helfen ? :cry:

MfG Bergmann89.
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: Di 04.04.06 20:31 
Zitat:
GetKeyState + F1 geht bei mir irgendwie nicht

Was geht denn nicht?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Mi 05.04.06 08:46 
Hi,
den Befehl gibts irgendwie nicht,
oder ich bin zu blöd den ins Programm einzufügen :P ,
weiß nähmlich nicht wo ?!

Kannst du mir ma igrednein Bsp zeigen, das würde
mir bestimmt helfen :lol: !

MfG Bergmann89.
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: Do 06.04.06 18:35 
Wenn ich GetKeyState in den Source schreibe und F1 druecke, bekomme ich:

Zitat:
The GetKeyState function retrieves the status of the specified virtual key. The status specifies whether the key is up, down, or toggled (on, off ¾ alternating each time the key is pressed).

SHORT GetKeyState(
int nVirtKey // virtual-key code
);


Parameters

nVirtKey

Specifies a virtual key. If the desired virtual key is a letter or digit (A through Z, a through z, or 0 through 9), nVirtKey must be set to the ASCII value of that character. For other keys, it must be a virtual-key code.
If a non-English keyboard layout is used, virtual keys with values in the range ASCII A through Z and 0 through 9 are used to specify most of the character keys. For example, for the German keyboard layout, the virtual key of value ASCII O (0x4F) refers to the "o" key, whereas VK_OEM_1 refers to the "o with umlaut" key.


Return Values

If the function succeeds, the return value specifies the status of the given virtual key. If the high-order bit is 1, the key is down; otherwise, it is up. If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled.


Remarks

The key status returned from this function changes as a given thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function to retrieve that information.
An application calls GetKeyState in response to a keyboard-input message. This function retrieves the state of the key when the input message was generated.
To retrieve state information for all the virtual keys, use the GetKeyboardState function.

An application can use the virtual-key code constants VK_SHIFT, VK_CONTROL, and VK_MENU as values for the nVirtKey parameter. This gives the status of the SHIFT, CTRL, or ALT keys without distinguishing between left and right. An application can also use the following virtual-key code constants as values for nVirtKey to distinguish between the left and right instances of those keys:

VK_LSHIFT
VK_RSHIFT

VK_LCONTROL
VK_RCONTROL

VK_LMENU
VK_RMENU

These left- and right-distinguishing constants are available to an application only through the GetKeyboardState, SetKeyboardState, GetAsyncKeyState, GetKeyState, and MapVirtualKey functions.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)