question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pls add support shift+tab

See original GitHub issue

I want use shift tab in inquirer. But readchar not read this keyevent

    print("Press a key")
    key = readchar.readkey()
    print("Key is {0}".format(key.encode()))
>>>Press a key
>>>shift+tab
>>>Key is b'\t'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Cube707commented, 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 your readchar import:

from readchar import readkey, key
key.SHIFT_TAB = "\x1b\x5b\x5a"

Now you can use it as expected:

while True:
    k = readkey()
    if k == key.SHIFT_TAB:
        print("got macro shortcut!!!!!")

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:

readchar relies on the standart libary msvcrt to do the actuall terminal interaction. If you take this exapmple:

from msvcrt import getch

while True:
	k = getch()
	print(k)

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.

0reactions
fleytmancommented, Jul 14, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

what is the key code for shift+tab? - javascript
The problem is that when I press the TAB button down it navigates to the next input field. But, what is the JavaScript...
Read more >
Drafts: Setup Tab / Shift-Tab Indentation Shortcuts - YouTube
Drafts: Setup Tab / Shift - Tab Indentation Shortcuts. 1.1K views 1 year ago. Agile Tortoise Support. Agile Tortoise Support.
Read more >
Steam: Enable/Disable/Change keys - Steam Overlay - YouTube
This super basic tutorial takes you through the steps of disabling/enabling the Steam Overlay, as well as changing it from the default Shift...
Read more >
Keyboard shortcuts
Move the focus to each command on the ribbon, forward or backward respectively. TAB, SHIFT+TAB. Move down, up, left, or right among the...
Read more >
Ctrl+tab to shift between tabs · Issue #4795
I would like to shift between tabs by typing Ctrl+tab, the same way I ... Can you please add support for Ctrl +...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found