-
Notifications
You must be signed in to change notification settings - Fork 12
Major rework, a lot more intuitive and user friendly! #11
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for giving interest to this project. I started this port as a pet project to learn more about interacting with system APIs, which explains the not so pythonic code xD. Speaking of debugging the code, I had the same issue with the original C program where the computer becomes locked (I had to restart the computer several times), and I don't know what to do to avoid this, the only way to mitigate this is hooking either keyboard or mouse, not both. Anyway, thank you for improvement, I appreciate the effort put into that, the code is acceptable, I just put some comments on the readme lines that need to be fixed to avoid confusion. |
Hey, thanks for taking a look. I personally have only been "locked out" from my inputs whenever an error occurred and I was running my IDE in debug mode, which caused the program to stall rather than terminate, thus inputs were still being intercepted but not relayed so to speak. The main problem causing the errors was the one I explained in issue #12, specifically when moving the mouse around. Since that change I havent had any problems no matter what I used it for.
Maybe im being an idiot but im unable to locate these comments, also yea I never intended to create a PR to this at first because honestly, didnt even expect it would be reviewed haha. So the readme is sorta irrelevant now |
corrected the MouseFlag.MOUSE_MOVE_RELATIVE in _consts.py updated the inputs.py to use real relative move, rather than getting the mouse position, add delta and abs move now can work better in fps games
`MOUSE_MOVE_RELATIVE` flag fix
key_down should be changed to hold_key in the example
Typo in README
Hey!
So, I needed to look into "real" inputs for some of my own projects. Eventually I learned about interception and found this python port for it, but honestly, I found it really hard to figure out how to use it with the provided code and examples, so I decided to spend some time on making it more intuitive, cleaner and more pythonic.
Major changes:
interception.py
modulestrokes
into more suitable class typesIntEnum
consts
andkeycodes
are now meant for internal use, the "API" usage is defined byinputs.py
inputs.py
is meant to operate just like pyautogui or pydirectinput would, so you can:press("w")
instead of creating aKeyStroke
with the codehold_mouse
andhold_key
to be used in awith
contextlisten_to_keyboard()
andlisten_to_mouse()
to grab ur device numbers respectivelyStuff I'd like to add in the future:
Hope the rework is to your liking, I think it would help alot of people if it was more friendly to use, thanks alot for providing the base to this port!