Skip to content

Add option to not enter keys on behalf of the user #86

@Notenlish

Description

@Notenlish

This was reported on yt:

Hi, when I put this into Alacritty in place of cachyos-fish-greeting, I get a weird notification on 
key press from krdp about an application requesting special privileges (control input devices). I'm
not sure what's going on here, but it's every time I open the terminal. I'm on CachyOS and using KDE
Plasma 6.6.3. Do you know what might be going on here? I'm kinda new to Linux.

The issue is caused by this:

# src/anifetch/core.py
if renderer.last_key:
    from pynput.keyboard import Controller, Key

    keyboard = Controller()

    # needed because if I only enter one key even though the user pressed a bunch of keys the keys will be entered disorderly(only the a single key is not automatically entered and the other keys are entered)
    # so we store the key, go to line start, enter the first key(that the user pressed) and then go to the end of line.
    # that way even if the user presses a bunch of keys, it will all be in order.

    # start of line
    keyboard.press(Key.home)
    keyboard.release(Key.home)

    keyboard.press(renderer.last_key)

    # end of line
    keyboard.press(Key.end)
    keyboard.release(Key.end)

    keyboard.release(renderer.last_key)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions