Java Code Examples for org.jline.keymap.KeyMap#setAmbiguousTimeout()

The following examples show how to use org.jline.keymap.KeyMap#setAmbiguousTimeout() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CliTableResultView.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<ResultTableOperation> getKeys() {
	final KeyMap<ResultTableOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultTableOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultTableOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultTableOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultTableOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultTableOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultTableOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultTableOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultTableOperation.GOTO, "g", "G");
	keys.bind(ResultTableOperation.NEXT, "n", "N");
	keys.bind(ResultTableOperation.PREV, "p", "P");
	keys.bind(ResultTableOperation.LAST, "l", "L", key(client.getTerminal(), Capability.key_end));
	keys.bind(ResultTableOperation.INC_REFRESH, "+");
	keys.bind(ResultTableOperation.DEC_REFRESH, "-");
	return keys;
}
 
Example 2
Source File: CliInputView.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<InputOperation> getKeys() {
	final KeyMap<InputOperation> keys = new KeyMap<>();
	keys.setUnicode(INSERT);
	keys.setAmbiguousTimeout(200); // make ESC quicker
	for (char i = 32; i < 256; i++) {
		keys.bind(INSERT, Character.toString(i));
	}
	keys.bind(LEFT, key(client.getTerminal(), Capability.key_left));
	keys.bind(RIGHT, key(client.getTerminal(), Capability.key_right));
	keys.bind(BACKSPACE, del());

	if (client.isPlainTerminal()) {
		keys.bind(ENTER, "\r", "$");
		keys.bind(QUIT, key(client.getTerminal(), Capability.key_exit), "!");
	} else {
		keys.bind(ENTER, "\r");
		keys.bind(QUIT, esc());
	}
	return keys;
}
 
Example 3
Source File: CliTableResultView.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<ResultTableOperation> getKeys() {
	final KeyMap<ResultTableOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultTableOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultTableOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultTableOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultTableOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultTableOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultTableOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultTableOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultTableOperation.GOTO, "g", "G");
	keys.bind(ResultTableOperation.NEXT, "n", "N");
	keys.bind(ResultTableOperation.PREV, "p", "P");
	keys.bind(ResultTableOperation.LAST, "l", "L", key(client.getTerminal(), Capability.key_end));
	keys.bind(ResultTableOperation.INC_REFRESH, "+");
	keys.bind(ResultTableOperation.DEC_REFRESH, "-");
	return keys;
}
 
Example 4
Source File: CliInputView.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<InputOperation> getKeys() {
	final KeyMap<InputOperation> keys = new KeyMap<>();
	keys.setUnicode(INSERT);
	keys.setAmbiguousTimeout(200); // make ESC quicker
	for (char i = 32; i < 256; i++) {
		keys.bind(INSERT, Character.toString(i));
	}
	keys.bind(LEFT, key(client.getTerminal(), Capability.key_left));
	keys.bind(RIGHT, key(client.getTerminal(), Capability.key_right));
	keys.bind(BACKSPACE, del());

	if (client.isPlainTerminal()) {
		keys.bind(ENTER, "\r", "$");
		keys.bind(QUIT, key(client.getTerminal(), Capability.key_exit), "!");
	} else {
		keys.bind(ENTER, "\r");
		keys.bind(QUIT, esc());
	}
	return keys;
}
 
Example 5
Source File: CliTableResultView.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<ResultTableOperation> getKeys() {
	final KeyMap<ResultTableOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultTableOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultTableOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultTableOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultTableOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultTableOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultTableOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultTableOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultTableOperation.GOTO, "g", "G");
	keys.bind(ResultTableOperation.NEXT, "n", "N");
	keys.bind(ResultTableOperation.PREV, "p", "P");
	keys.bind(ResultTableOperation.LAST, "l", "L", key(client.getTerminal(), Capability.key_end));
	keys.bind(ResultTableOperation.INC_REFRESH, "+");
	keys.bind(ResultTableOperation.DEC_REFRESH, "-");
	return keys;
}
 
Example 6
Source File: CliRowView.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<RowOperation> getKeys() {
	final KeyMap<RowOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(RowOperation.QUIT, "q", "Q", esc());
	keys.bind(RowOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(RowOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(RowOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(RowOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	return keys;
}
 
Example 7
Source File: CliInputView.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected KeyMap<InputOperation> getKeys() {
	final KeyMap<InputOperation> keys = new KeyMap<>();
	keys.setUnicode(INSERT);
	keys.setAmbiguousTimeout(200); // make ESC quicker
	for (char i = 32; i < 256; i++) {
		keys.bind(INSERT, Character.toString(i));
	}
	keys.bind(LEFT, key(client.getTerminal(), Capability.key_left));
	keys.bind(RIGHT, key(client.getTerminal(), Capability.key_right));
	keys.bind(BACKSPACE, del());

	if (client.isPlainTerminal()) {
		keys.bind(ENTER, "\r", "$");
		keys.bind(QUIT, key(client.getTerminal(), Capability.key_exit), "!");
	} else {
		keys.bind(ENTER, "\r");
		keys.bind(QUIT, esc());
	}
	return keys;
}
 
Example 8
Source File: CliChangelogResultView.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyMap<ResultChangelogOperation> getKeys() {
	final KeyMap<ResultChangelogOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultChangelogOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultChangelogOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultChangelogOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultChangelogOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultChangelogOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultChangelogOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultChangelogOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultChangelogOperation.INC_REFRESH, "+");
	keys.bind(ResultChangelogOperation.DEC_REFRESH, "-");
	return keys;
}
 
Example 9
Source File: CliRowView.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyMap<RowOperation> getKeys() {
	final KeyMap<RowOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(RowOperation.QUIT, "q", "Q", esc());
	keys.bind(RowOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(RowOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(RowOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(RowOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	return keys;
}
 
Example 10
Source File: CliChangelogResultView.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyMap<ResultChangelogOperation> getKeys() {
	final KeyMap<ResultChangelogOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultChangelogOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultChangelogOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultChangelogOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultChangelogOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultChangelogOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultChangelogOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultChangelogOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultChangelogOperation.INC_REFRESH, "+");
	keys.bind(ResultChangelogOperation.DEC_REFRESH, "-");
	return keys;
}
 
Example 11
Source File: CliRowView.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyMap<RowOperation> getKeys() {
	final KeyMap<RowOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(RowOperation.QUIT, "q", "Q", esc());
	keys.bind(RowOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(RowOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(RowOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(RowOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	return keys;
}
 
Example 12
Source File: CliChangelogResultView.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyMap<ResultChangelogOperation> getKeys() {
	final KeyMap<ResultChangelogOperation> keys = new KeyMap<>();
	keys.setAmbiguousTimeout(200); // make ESC quicker
	keys.bind(ResultChangelogOperation.QUIT, "q", "Q", esc(), ctrl('c'));
	keys.bind(ResultChangelogOperation.REFRESH, "r", "R", key(client.getTerminal(), Capability.key_f5));
	keys.bind(ResultChangelogOperation.UP, "w", "W", key(client.getTerminal(), Capability.key_up));
	keys.bind(ResultChangelogOperation.DOWN, "s", "S", key(client.getTerminal(), Capability.key_down));
	keys.bind(ResultChangelogOperation.LEFT, "a", "A", key(client.getTerminal(), Capability.key_left));
	keys.bind(ResultChangelogOperation.RIGHT, "d", "D", key(client.getTerminal(), Capability.key_right));
	keys.bind(ResultChangelogOperation.OPEN, "o", "O", "\r");
	keys.bind(ResultChangelogOperation.INC_REFRESH, "+");
	keys.bind(ResultChangelogOperation.DEC_REFRESH, "-");
	return keys;
}