Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. See if a key was presssed
Qt 6.11 is out! See what's new in the release blog

See if a key was presssed

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 4 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Sucharek

    The ones that are completely separate windows belonging to other applications, so the 3rd option you listed.

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #8

    @Sucharek
    Then like I said I do not think Qt offers anything for that, and I do not know if the Windows OS/windowing system even allows it from a normal program (e.g. not the device driver, and excluding specialist software like "keyloggers").

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by hskoglund
      #9

      Hi, for listening to keystrokes regardless of which program or window they end up in, there are a couple of Win32 API:s you can use from a normal (unprivileged) program, for example: SetWindowsHookExW()

      JonBJ 1 Reply Last reply
      3
      • hskoglundH hskoglund

        Hi, for listening to keystrokes regardless of which program or window they end up in, there are a couple of Win32 API:s you can use from a normal (unprivileged) program, for example: SetWindowsHookExW()

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #10

        @hskoglund said in See if a key was presssed:

        you can use from a normal (unprivileged) program, for example: SetWindowsHookExW()

        Wow! So without any warning or elevated privilege, any Windows program I install could be logging all keystrokes I make in any application? Nice.

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #11

          Yes, it's been around since Windows 3.0, there's an older forum discussion here
          I posted an example program there, see if I can get the link to gitlab working again...

          JonBJ 1 Reply Last reply
          3
          • hskoglundH hskoglund

            Yes, it's been around since Windows 3.0, there's an older forum discussion here
            I posted an example program there, see if I can get the link to gitlab working again...

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #12

            @hskoglund
            Indeed! There is a blow-by-blow discussion in https://0x00sec.org/t/windows-keylogging-part-i/99

            Scary how easy Windows makes it!

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #13

              As I remember it, those API:s were initially designed for training/teaching how to use a computer (not for spying on you!) for example the acronym CBT you'll see in the docs stands for Computer Base Training :-)

              J.HilkJ 1 Reply Last reply
              3
              • hskoglundH hskoglund

                As I remember it, those API:s were initially designed for training/teaching how to use a computer (not for spying on you!) for example the acronym CBT you'll see in the docs stands for Computer Base Training :-)

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #14

                @hskoglund the root to hell is paved with good intentions....

                but this is also the reason, why anti-cheat software from games has to be so terrible invasive on the Operating System.


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Sucharek
                  wrote on last edited by Sucharek
                  #15

                  Hi all, thanks for your replies, but I think I'm gonna have to stick with only the mouse movement. If I get this right, it won't work on Linux, so that's a bad thing.
                  Edit: Messing with Windows APIs is something I have no idea how to do and it would take days for me to learn it. The mouse is probably the only way.
                  Thanks again for your answers.

                  JonBJ 1 Reply Last reply
                  0
                  • S Sucharek

                    Hi all, thanks for your replies, but I think I'm gonna have to stick with only the mouse movement. If I get this right, it won't work on Linux, so that's a bad thing.
                    Edit: Messing with Windows APIs is something I have no idea how to do and it would take days for me to learn it. The mouse is probably the only way.
                    Thanks again for your answers.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #16

                    @Sucharek
                    I never knew why you needed to track key presses to other applications. And I hope Linux doesn't allow it anyway! :)

                    I don't know whether it helps, but you can (I believe) track focus changes/activate/deactivate windows in your app. Which I think would accompany going typing keys into another application. Maybe you could investigate those?

                    S 1 Reply Last reply
                    1
                    • JonBJ JonB

                      @Sucharek
                      I never knew why you needed to track key presses to other applications. And I hope Linux doesn't allow it anyway! :)

                      I don't know whether it helps, but you can (I believe) track focus changes/activate/deactivate windows in your app. Which I think would accompany going typing keys into another application. Maybe you could investigate those?

                      S Offline
                      S Offline
                      Sucharek
                      wrote on last edited by
                      #17

                      Ok, I maybe I'll take a look at that. Thanks.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved