I\'m trying to write a program that simulates the terminal tab completion. But I\'m unsure of how to trap the tab key. This is a non gui application. I\'m not looking for swing/
After some googling, i found that there are quite a few java libraries for handling console input. Some of them are:
1. jLine
2. Lanterna
3. Java Curses Library
4. Charva
5. Blacken
jLine have features like custom keybinds, tab completion, line editing etc. jLine have method like readVirtualKey that reads a virtual key from the console e.g. VK_UP.
You can also implement auto complete functionality using tab key. You might have to implement your own Completer class for that. Have a look at the link given below, it clearly shows tab completion functionality. May be that is what you need.
https://jeszysblog.wordpress.com/2012/04/14/readline-style-command-line-editing-with-jline/