I would like to show a light dialog in my console app (it uses libslang to handle the terminal) – it should be explicitly a temporary dialog, shown quickly to peek some information to then be closed.
I think that therefore it should be shown when some key is pressed and hold in this state, and hidden when the key is released.
However, I've hit the obstacle: can you actually detect that a key is continuously pressed in a terminal environment? Is this possible? Or maybe I'm doing X/Y problem and there is completely different way of achieving what I've described (either the temporariness of the dialog or the way of activating it)?
question from:
https://stackoverflow.com/questions/65931605/can-you-detect-that-a-key-is-being-constantly-pressed-in-a-terminal-app 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…