Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Zitat von »"msdn2"«
Return Value
If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Remarks.
Windows NT/2000/XP: The return value is zero for the following cases:
* The current desktop is not the active desktop
* The foreground thread belongs to another process and the desktop does not allow the hook or the journal record.
Windows 95/98/Me: The return value is the global asynchronous key state for each virtual key. The system does not check which thread has the keyboard focus.
Windows 95/98/Me: Windows 95 does not support the left- and right-distinguishing constants. If you call GetAsyncKeyState with these constants, the return value is zero.
Administrator
Zitat von »"TrommlBomml"«
es muss so weit ich weiss kleiner 0 sein. probier das mal
C-/C++-Quelltext |
|
1 2 3 4 5 |
int iResult = GetAsyncKeyState(VK_RETURN); if(Position == 15 && iResult >> 31) { // Taste gedrückt und Position ist gleich 15... } |
Zitat von »"Faule Socke"«
Ich mag "spezielle" lösungen.... xD
C-/C++-Quelltext |
|
1 |
::GetAsyncKeyState(VK_RETURN) |
C-/C++-Quelltext |
|
1 |
(::GetAsyncKeyState(VK_RETURN) & 0x8000) |
C-/C++-Quelltext |
|
1 2 |
if (position == 15 && ::GetAsyncKeyState(VK_RETURN) & 0x8000) { /* TODO: Your Code! */ } |
C-/C++-Quelltext |
|
1 |
::GetAsyncKeyState(VK_RETURN) < 0 |
C-/C++-Quelltext |
|
1 2 |
if (position == 15 && ::GetAsyncKeyState(VK_RETURN) < 0) { /* TODO: Your Code! */ } |
Werbeanzeige