Python Forum

Full Version: Pynput - no capital letters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a known issues with Windows 10 to where it doesn't recognize characters modified by shift or Caps Lock?
It does record the key event of the shift press.

Anyone know if I'm missing something ?

from pynput.keyboard import Listener

def look_for_key(key):
        
    letter = str(key)
    letter = letter.replace("'", "")
        
    if letter == 'Key.esc':
        return False
    
    print(letter)


with Listener(on_press = look_for_key) as l:
    l.join()
The key controller works, allowing me to send "Hello World", but I am unable to identify a 'H' only 'h'. I tried running under admin with the same result.
Made a Win7 VM machine with the same result (I was really hoping it would be a win10 issue), same result. Also tried installing PyCharm as that's what a few of the videos show (youtu.be/WkE0QJu3ug8?t=374)
I believe it should be catching all Alt key actions, otherwise we wouldn't be able to code for laptops with often unique Alt key actions.

Anyhow, I'll let this die until I have an answer for others to post.