moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.77k stars 245 forks source link

Is it normal executing scripts using this library on wine not working? #483

Open i30817 opened 2 years ago

i30817 commented 2 years ago

Description I don't have windows, so i'm testing on wine, on 'wine cmd' and on wenv. I have a very simple script. In the script the prints or the suppression never happen, although the listener is waiting on the join.

Platform and pynput version Linux sleipnir 5.13.0-48-generic #54~20.04.1-Ubuntu SMP Thu Jun 2 23:37:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

__version__ = (1, 7, 6)

To Reproduce

#! /usr/bin/env python3

from pynput import keyboard

def press(key):
    print('wtf')

def release(key):
    print('bimbo')

def mainaux():
    listener = keyboard.Listener(on_press=press, on_release=release, suppress=True)
    with listener:
        listener.join()

def main():
    mainaux()
    return 0

if __name__ == "__main__":
    mainaux()

This is the test script, and although i'm installing it as a pip package i suppose it can be run from a file, with wine python script.py or wine cmd 'python script.py' or wenv script.py (if you bother with that, after calling wenv cache and wenv init and wenv pip install pynput).

This is a bit like other python libraries (like pick) that say they work fine in windows but fail in wine so i'm not quite sure if the program is working yet.

i30817 commented 2 years ago

I'm also in X11, if it matters for this.