You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You didn't provide this crutial information, but from the fact that you only get a single TAB back, I assume you are on windows?
Windows doesn't modify the tab-key when pressing shift, it always just reads TAB. So it is imposible to use TAB+SHIFT on windows, this has nothing to do with readchar() but is simply a windows limitation.
We could add it to the Linux side, but I would still not recomend using it as it is not portable...
I'm use macos. It’s a pity that it won’t work for Windows, of course I want a cross-platform implementation. But support for *nix would also be nice.
If you think about support in windows, is it possible to have a solution for a power shell or a windows terminal? As a last resort, there is wsl or cygwin.
This will have to wait but will probably come at some point. For now the project maintainer is not responding and untill he does I am just a powerless contributer myself. You can however, for the ime beeing, patch the key-module for unix systems with this line after your readchar import:
you will see that both pressing TAB and SHIFT+TAB result in the same output of b'\t'. Windows doesn't provide this keycombination to python so it is imposible to handle it.
Thanks for your answer. I found why I can't use readchar.readkey(), it's #11 problem. Pycharm terminal != system terminal. In system macos term i can read shift+tab.
Activity
Cube707 commentedon Jul 9, 2022
You didn't provide this crutial information, but from the fact that you only get a single
TABback, I assume you are on windows?Windows doesn't modify the tab-key when pressing shift, it always just reads
TAB. So it is imposible to useTAB+SHIFTon windows, this has nothing to do withreadchar()but is simply a windows limitation.We could add it to the Linux side, but I would still not recomend using it as it is not portable...
fleytman commentedon Jul 11, 2022
I'm use macos. It’s a pity that it won’t work for Windows, of course I want a cross-platform implementation. But support for *nix would also be nice.
If you think about support in windows, is it possible to have a solution for a power shell or a windows terminal? As a last resort, there is wsl or cygwin.
Cube707 commentedon Jul 11, 2022
For *nix support
This will have to wait but will probably come at some point. For now the project maintainer is not responding and untill he does I am just a powerless contributer myself. You can however, for the ime beeing, patch the
key-module for unix systems with this line after yourreadcharimport:Now you can use it as expected:
You can get the codes for other unsported keys by running my testing script, it will print you the codes for all pressed keys.
For windows support:
readcharrelies on the standart libarymsvcrtto do the actuall terminal interaction. If you take this exapmple:you will see that both pressing
TABandSHIFT+TABresult in the same output ofb'\t'. Windows doesn't provide this keycombination to python so it is imposible to handle it.fleytman commentedon Jul 14, 2022
Thanks for your answer. I found why I can't use readchar.readkey(), it's #11 problem. Pycharm terminal != system terminal. In system macos term i can read shift+tab.
add shift+tab
add shift+tab
fleytman commentedon Jul 14, 2022
It's work with inquirer magmax/python-inquirer#170
add key SHIFT+TAB