Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending capital letter returns; a #136

Open
JeffreyDavidsz opened this issue Feb 11, 2019 · 10 comments
Open

Sending capital letter returns; a #136

JeffreyDavidsz opened this issue Feb 11, 2019 · 10 comments

Comments

@JeffreyDavidsz
Copy link

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

@willstout
Copy link

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

@moses-palmer
Copy link
Owner

moses-palmer commented Feb 13, 2019 via email

@JeffreyDavidsz
Copy link
Author

JeffreyDavidsz commented Feb 13, 2019

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
Copy link
Author

I did not test the keyboard.type functionality completely

@willstout
Copy link

willstout commented Feb 13, 2019

Currently using OSX and Pynput version 1.4.

Thanks for the workaround @JeffreyDavidsz !

@JeffreyDavidsz
Copy link
Author

@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?)

@SpecialCharacter
Copy link

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"?

@JeffreyDavidsz
Copy link
Author

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

@SpecialCharacter
Copy link

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?

@radixcl
Copy link

radixcl commented Sep 13, 2019

I've got this problem too:

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

I'm running MacOS 10.14.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants