| 1 | package com.googlecode.lanterna.gui2; |
| 2 | |
| 3 | import com.googlecode.lanterna.input.KeyStroke; |
| 4 | |
| 5 | /** |
| 6 | * This interface can be used to programmatically intercept input from the user and decide if the input should be passed |
| 7 | * on to the interactable. It's also possible to fire custom actions for certain keystrokes. |
| 8 | */ |
| 9 | public interface InputFilter { |
| 10 | /** |
| 11 | * Called when the component is about to receive input from the user and decides if the input should be passed on to |
| 12 | * the component or not |
| 13 | * @param interactable Interactable that the input is directed to |
| 14 | * @param keyStroke User input |
| 15 | * @return {@code true} if the input should be passed on to the interactable, {@code false} otherwise |
| 16 | */ |
| 17 | boolean onInput(Interactable interactable, KeyStroke keyStroke); |
| 18 | } |