pynput icon indicating copy to clipboard operation
pynput copied to clipboard

Sending capital letter returns; a

Open JeffreyDavidsz opened this issue 5 years ago • 10 comments

When I use the folowing;

keyboard.press(key) keyboard.release(key)

and key is a capital letter like T, it actually returns the letter a

JeffreyDavidsz avatar Feb 11 '19 11:02 JeffreyDavidsz

Oh thank god someone else was having this issue, I only get A back. Numbers get pressed and release just fine but when I use keyboard.type(some numbers as a string) they too get turned to just the letter a. This is fairly critical for my project

willstout avatar Feb 13 '19 06:02 willstout

That does indeed sound strange. What platforms are you using?

On Wed, 13 Feb 2019, 07:00 willstout <[email protected] wrote:

Oh thank god someone else was having this issue, I only get A back. Numbers get pressed and release just fine but when I use keyboard.type(some numbers as a string) they too get turned to just the letter a. This is fairly critical for my project

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moses-palmer/pynput/issues/136#issuecomment-463070845, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjOYwgJpQ0DRj9aV27Hzu-urRO2oxdLks5vM6oSgaJpZM4a0BQY .

moses-palmer avatar Feb 13 '19 06:02 moses-palmer

I'm using it on both windows and osx. The problem only occurred on osx. The workaround I use (@willstout) is using shift and a string.lower() that works; Keyboard.press(Key.shift) Keyboard.press(convertedString) Keyboard.release(convertedString) Keyboard.release(Key.shift)

JeffreyDavidsz avatar Feb 13 '19 06:02 JeffreyDavidsz

I did not test the keyboard.type functionality completely

JeffreyDavidsz avatar Feb 13 '19 06:02 JeffreyDavidsz

Currently using OSX and Pynput version 1.4.

Thanks for the workaround @JeffreyDavidsz !

willstout avatar Feb 13 '19 07:02 willstout

@moses-palmer I see an other issue whit Keyboard.type. This sometimes returns an a also. Did not see it myself but I think it's related. Maybe in newer versions of OSX something changed in the layout of the keyboard (command wise?)

JeffreyDavidsz avatar Feb 13 '19 08:02 JeffreyDavidsz

Same kind of problem here (PC, Windows 10, Pynput version 1.4). Tried to execute code I had written on an older PC. When I type S, the listener returns special key Key.shift pressed key 's' pressed key 's' released key Key.shift released. How can I teach it that "shift s" is "S"?

SpecialCharacter avatar Mar 09 '19 09:03 SpecialCharacter

Not quite sure what your question is. The workaround works, untill the problem is fixed, I stay to that

JeffreyDavidsz avatar Mar 10 '19 06:03 JeffreyDavidsz

Sorry, so I need the listener to give me a big S, but so far I'm only getting shift+s. Is there an easy way to implement this?

SpecialCharacter avatar Mar 10 '19 20:03 SpecialCharacter

I've got this problem too:

>>> from pynput import keyboard
>>> controller = keyboard.Controller()
>>> controller.press("S")
>>> a

I'm running MacOS 10.14.5

radixcl avatar Sep 13 '19 01:09 radixcl