moses-palmer / pynput

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

Keyboard listener only works with admin privileges in certain applications #375

Closed ShiverPurple closed 3 years ago

ShiverPurple commented 3 years ago

Is this supposed to happen? Without privileges, if I open the Task Manager, for example, the listener just ignores my key shortcut, but it works fine on the desktop or any windows folder. None of the game applications i tried worked, but it's strange it happens even in Task Manager.

After a lot of search and trying different things, i notice thar if i run my script as admin the shortcut works fine in any situation, but i really rather not have to ask for user permission every time i open it.

moses-palmer commented 3 years ago

You will find that any application that runs under elevated privileges will require you to run your script as administrator. This is built into the Windows security model, and prevents attacks such as trying to record passwords entered into administrator windows.