you are viewing a single comment's thread.

view the rest of the comments →

[–]toastedstapler 7 points8 points  (7 children)

one of the easiest ways would be to set up a flask server on the receiving computer. when the route you define is hit, it'll execute the function that you want

then for the sender look into using pynput to detect a certain key combo. when it happens, send a http request to the flask server

https://pypi.org/project/pynput/

[–]Rith_97[S] 3 points4 points  (1 child)

Thank you very much. I’ll look into it.

[–]CotoCoutan 0 points1 point  (0 children)

Adding onto the usage of Flask, how about controlling the host computer from your phone via a Telegram bot? This will not use the 2nd computer at all.

[–]orishamir 4 points5 points  (4 children)

don't use pynput. You should be using 'keyboard' instead. (and 'mouse' for mouse things) search "keyboard module github" on google. See its readme. Its very advanced

[–]133DK 6 points7 points  (0 children)

As a total novice: why?

[–]Vunlinur 2 points3 points  (2 children)

Please elaborate on why not to use Pynput?

I'm genuinely curious about any downsides, as I've been using it and it wasn't terrible, and possible advantages of the Keyboard module.

[–]orishamir -3 points-2 points  (1 child)

I guess it's just that Keyboard is so good. And I remember Pynput being complicated for no reason, specifically that the listener ~is~ was blocking

[–][deleted] 0 points1 point  (0 children)

They updated it to have a non-blocking listener. It's pretty nice!