import java.util.HashMap;
import java.util.Map;

public final class Main {

    private final Map<Character, Runnable> map;

    public Main() {
        map = new HashMap<>();
        map.put('h', () -> moveCursorLeft());
        map.put('j', () -> moveCursorUp());
        map.put('k', () -> moveCursorDown());
        map.put('l', () -> moveCursorRight());
    }

    public void handleKeyInput() {
        var c = getPressedKey();
        var action = map.get(c);
        if (action == null) {
            // Does nothing with keys not associated with actions.
            return;
        }
        action.run();
    }

    /**
        Returns the character of the pressed key.
        If no key is pressed, blocks until any key is pressed.

        @return
            The character of the pressed key.
    */
    private char getPressedKey() {
        return 'a';
    }

    private void moveCursorRight() {}
    private void moveCursorUp() {}
    private void moveCursorDown() {}
    private void moveCursorLeft() {}

    public static void main(String[] args) {
        var m = new Main();
        m.handleKeyInput();
    }
}
