0
        int readChar = cnslRdr.readCharacter();
        if ( readChar == 9){                
                if (cnslRdr.readCharacter() == 9 ){                                         
                    cnslRdr.println("Double tab presssed..");                       
                    continue;
                }               
        }

The above code when run in commandprompt is not detecting the first character typed. The above logic is used to detect Double Tab key press in Jline2.14 console Reader

Nagarajan
  • 11
  • 1

1 Answers1

0

I looked at the documentation for this method and it seems to have a different signature than the one you are using.

public final int readCharacter(char[] allowed){...}

I didn't see any other overloads. I don't have any experience with JLine, but it may be that you need to pass an argument like new char[]{'\t'} to allow it to detect that keystroke.

Source: http://jline.sourceforge.net/javadoc/jline/ConsoleReader.html

Jared
  • 26
  • 4