Most active commenters

    Gregglogger

    (untested.sonnet.io)
    43 points rpastuszak | 11 comments | | HN request time: 1.272s | source | bottom
    1. krackers ◴[] No.42200322[source]
    >To my knowledge, this can be fixed by requesting the OS-level accessibility permissions, which would require a separate user interaction.

    Does this imply that running Gregglogger _doesn't_ require granting accessibility input monitoring permission? On osx there's at least 4 ways to monitor inputs I think (iokit level, cgeventap, carbon event monitoring, cocoa global event monitor), I'd really expect all of them to require the input monitoring permission.

    replies(1): >>42200509 #
    2. wizerno ◴[] No.42200509[source]
    It looks like you're correct -- Gregglogger relies on pynput, and its behavior on macOS aligns with the library's documented limitations [1]:

    Recent versions of macOS restrict monitoring of the keyboard for security reasons. For that reason, one of the following must be true:

    - The process must run as root.

    - Your application must be whitelisted under "Enable access for assistive devices." Note that this might require packaging your application, since otherwise the entire Python installation must be whitelisted.

    - On macOS versions after Mojave, you may also need to whitelist your terminal application if running your script from a terminal.

    [1] https://pynput.readthedocs.io/en/stable/limitations.html#mac...

    3. gregsadetsky ◴[] No.42200672[source]
    Hi, I’m the “greg”. AMA??

    But also, this is Rafal’s project. I’m just a huge huge fan of his..! See:

    https://sit.sonnet.io/

    https://untested.sonnet.io/

    And https://www.potato.horse/ !

    replies(1): >>42201483 #
    4. WD-42 ◴[] No.42200812[source]
    Fun read, thanks.

    I also wrote a 5ish line python script that instead of logging keys, presses them. I used it to avoid idle detection in a game a few years ago. Similarly to you, I found it somewhat disconcerting how easy it was. This was on windows though.

    5. usefulcat ◴[] No.42201483[source]
    Followed one of the links in your article and ended up unexpectedly watching a video review of different types of canned fish (https://www.youtube.com/watch?v=rymwqxBkxus). Wasn't expecting that, but I must say I did rather enjoy it.
    replies(1): >>42202886 #
    6. 0x416c6578 ◴[] No.42202462[source]
    I’ve now spent about half an hour watching videos about canned fish, must say it’s a fascinating topic
    7. gregsadetsky ◴[] No.42202886{3}[source]
    You’ve been Rafal’d! Welcome to the club :)
    8. AtlasBarfed ◴[] No.42211542[source]
    Linux, especially wayland, is making keylogging and keypress manipulation really hard. This is hitting me in one of my passions: retro gaming.

    I WANNA DO MACROS, but I haven't found any good solution for macros in linux (think dragon punch in Street Fighter or some other complex HID input sequence that teenies can master but oldass me can't)

    And I understand why, it's a massive security problem, giving view powers to the keystream, to say nothing of manipulation.

    I hope that retroarch eventually adds it, but they punt on it currently I think for the exact reasons I have problems with it.

    Does anyone know any good solutions out there for X.org and Wayland?

    replies(1): >>42211738 #
    9. serbuvlad ◴[] No.42211738[source]
    There is an xdg-desktop-portal which an application can use to register a global shortcut.

    https://github.com/flatpak/xdg-desktop-portal/blob/main/data...

    Not sure which compositor support this and which ones don't. Hyprland, which I use, supports it.

    There is also ydotool, which can emit key presses anywhere in Linux by registering a virtual uinput device.

    https://github.com/ReimuNotMoe/ydotool

    Using these two building blocks, it should not be very difficult to implement an application that implements global macro support.

    replies(1): >>42218448 #
    10. AtlasBarfed ◴[] No.42218448{3}[source]
    Thanks