Python Forum
Pynput - no capital letters - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: General Coding Help (https://python-forum.io/Forum-General-Coding-Help)
+--- Thread: Pynput - no capital letters (/Thread-Pynput-no-capital-letters)



Pynput - no capital letters - jmair - Feb-10-2019

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()



RE: Pynput - no capital letters - jmair - Feb-11-2019

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.


RE: Pynput - no capital letters - jmair - Feb-12-2019

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.