本文整理了Java中io.termd.core.readline.Keymap.bindFunction()
方法的一些代码示例,展示了Keymap.bindFunction()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keymap.bindFunction()
方法的具体详情如下:
包路径:io.termd.core.readline.Keymap
类名称:Keymap
方法名:bindFunction
[英]Bind a function to a key sequence, the key seq must be in inputrc format.
[中]将函数绑定到密钥序列,密钥序列必须为inputrc格式。
代码示例来源:origin: io.termd/termd-core
/**
* Bind a function to a key sequence, the key seq must be in <i>inputrc</i> format.
*
* @param keyseq the key sequence
* @param function the function to bind
* @return this keymap
*/
public Keymap bindFunction(String keyseq, String function) {
return bindFunction(InputrcParser.parseKeySeq(keyseq), function);
}
代码示例来源:origin: termd/termd
/**
* Bind a function to a key sequence, the key seq must be in <i>inputrc</i> format.
*
* @param keyseq the key sequence
* @param function the function to bind
* @return this keymap
*/
public Keymap bindFunction(String keyseq, String function) {
return bindFunction(InputrcParser.parseKeySeq(keyseq), function);
}
代码示例来源:origin: termd/termd
public static void handle(TtyConnection conn) {
// The reverse function simply reverse the edit buffer
Function reverseFunction = new ReverseFunction();
ReadlineExample.readline(
// Bind reverse to Ctrl-g to the reverse function
new Readline(Keymap.getDefault().bindFunction("\\C-g", "reverse")).
addFunctions(Function.loadDefaults()).addFunction(reverseFunction),
conn);
}
代码示例来源:origin: io.termd/termd-core
public static void handle(TtyConnection conn) {
// The reverse function simply reverse the edit buffer
Function reverseFunction = new ReverseFunction();
ReadlineExample.readline(
// Bind reverse to Ctrl-g to the reverse function
new Readline(Keymap.getDefault().bindFunction("\\C-g", "reverse")).
addFunctions(Function.loadDefaults()).addFunction(reverseFunction),
conn);
}
代码示例来源:origin: com.alibaba.middleware/termd-core
@Test
public void bindFunction2() {
Keymap keymap = new Keymap();
keymap.bindFunction(new int[]{'J' - 64}, "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
}
代码示例来源:origin: io.termd/termd-core
@Test
public void bindFunction1() {
Keymap keymap = new Keymap();
keymap.bindFunction("\\C-j", "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
代码示例来源:origin: com.alibaba.middleware/termd-core
@Test
public void bindFunction1() {
Keymap keymap = new Keymap();
keymap.bindFunction("\\C-j", "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
代码示例来源:origin: termd/termd
@Test
public void bindFunction2() {
Keymap keymap = new Keymap();
keymap.bindFunction(new int[]{'J' - 64}, "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
}
代码示例来源:origin: termd/termd
@Test
public void bindFunction1() {
Keymap keymap = new Keymap();
keymap.bindFunction("\\C-j", "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
代码示例来源:origin: io.termd/termd-core
@Test
public void bindFunction2() {
Keymap keymap = new Keymap();
keymap.bindFunction(new int[]{'J' - 64}, "my-func");
EventQueue eq = new EventQueue(keymap);
eq.append('J' - 64);
assertEquals("my-func", ((FunctionEvent) eq.next()).name());
assertFalse(eq.hasNext());
}
}
内容来源于网络,如有侵权,请联系作者删除!