SavinaRoja / PyUserInput

A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.
GNU General Public License v3.0
1.07k stars 244 forks source link

Prevent Keyboard Actions while still listening #42

Open ranji2612 opened 10 years ago

ranji2612 commented 10 years ago

Hi, Is it possible to listen to user's keyboard actions using pyKeyboard but does not allow the system to react to the actions.

For example, say the user pressed ALT + TAB.. We have to detect that he pressed those buttons, but we should prevent the system to take action for the ALT+TAB.. Like the PyHook for instance..

Thanks in Advance..

SavinaRoja commented 10 years ago

@ranji2612 That feature in PyKeyboardEvent still requires some development, it is planned but not yet implemented.

ranji2612 commented 10 years ago

@SavinaRoja Is the same feature available for PyMouse ?

SavinaRoja commented 10 years ago

That feature is implemented in PyMouseEvent with the capture and capture_move instantiation arguments.

Sorry, that I took a while to respond, I must have closed the tab before submitting my reply.

forevertheuni commented 9 years ago

Oh awesome that it can do this. I want to write something to help me with a video game and if I move my mouse around while my macro is working it will click and copy text from somewhere else.

Savina, could you help me with a simple example of that PyMouseEvent instantiation?

class blabblablal(PyMouseEvent(capture_move=True)):??

I used PyMouseEvent to get position while clicking already, but my main loop uses pymouse. commands" I guess I should change the loop to put everything to a PyMouseEvent Class object and put it in a hang while doing it's thing.

Thanks for the module!!