0

How can I instruct readline to convert keyboard intput to upper case, as it is typed, and have that be the echo to the terminal?

(Related, python: Convert input to upper case on screen as it is typed — which asks a different question trying to achieve a similar result. This is not a Python-specific question, so is not a duplicate of that one.)

The program I'm writing (which is Python 3 code, if that matters) uses the readline library for command line input, so implementing conversion of each keystroke is not an option. I'm looking for a way to do this by requesting the readline library do it for me.

The existing commands upcase-word and downcase-word are for the user to invoke, to deliberately change the case of text already typed. That isn't what I need; instead I want the text to be changed immediately as it's typed in.

bignose
  • 30,281
  • 14
  • 77
  • 110

1 Answers1

0

You have only 3 options I guess:

  1. Changing your Keyboard firmware in way that it sends a CAPS-Lock on signal in start-up!
  2. Modifying your keyboard driver in the operation System to send the OS uppercase letters instead of the lower-cases.
  3. Modifying source code of the Shell that you see the result of your Typing inside, in a way that it show upper-cases always.

You can't aim this goal using the program is running!

EbraHim
  • 2,279
  • 2
  • 16
  • 28