Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GetAsyncKeyState Problem

Empfohlene Antworten

Veröffentlicht

also ich habe mir mit visual basic für den gemeinsamen pc meiner familie einen keylogger "gebastelt".

jetzt wollte ich das gleich mit c++ versuchen, um generell etwas dazu zu lernen


void keystate() {

    while(true) {

        if(GetAsyncKeyState(0x41) = WM_KEYDOWN) {

            cout<<"a";

            log+="a";

         };

         if(GetAsyncKeyState(0x42)) {

             cout<<"b";

             log+="b";

         };

         if(GetAsyncKeyState(0x43)) {

              cout<<"c";

              log+="c";

         };


         //das ganze bis zum z


         Sleep(1);

    };

}
so dann rufe ich diese funktion auf und wenn ich das a drücke kommen bis zu 20 a, was ich eigtl nicht will ^^ ich hab das sleep schon auf 150 erhöht, aber dann werden eventuell nicht alle tasten aufgenommen bei vb gabs dazu
If GetAsyncKeyState(Keys.A) = --32767
damit nur die einmal das "then" ausgeführt wird, nämlich wenn die taste gedrückt wird gibt es sowas auch bei c++ weil

if(GetAsyncKeyState(0x41) = WM_KEYDOWN) {

    cout<<"a";

    log+="a";

};

leider nicht geeht :S

ich meinte

If GetAsyncKeyState(Keys.A) = -32767

-32767 gibt's in C++ auch.

Vergleiche macht man allerdings mit doppelten Gleichheitszeichen. Einzelne Gleichheitszeichen bewirken eine Zuweisung.

Und bei nächsten Mal bitte eine bessere Fehlerbeschreibung als "geht leider nicht :S". Weniger komische Smileys, mehr Fehlermeldung ;)

okay vielen dank

ich werd mal googeln

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.