io.termd.core.readline.KeyEvent.getCodePointAt()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中io.termd.core.readline.KeyEvent.getCodePointAt()方法的一些代码示例,展示了KeyEvent.getCodePointAt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.getCodePointAt()方法的具体详情如下:
包路径:io.termd.core.readline.KeyEvent
类名称:KeyEvent
方法名:getCodePointAt

KeyEvent.getCodePointAt介绍

暂无

代码示例

代码示例来源:origin: io.termd/termd-core

default IntBuffer buffer() {
 int length = length();
 IntBuffer buf = IntBuffer.allocate(length);
 for (int i = 0;i < length;i++) {
  buf.put(getCodePointAt(i));
 }
 buf.flip();
 return buf;
}

代码示例来源:origin: termd/termd

default IntBuffer buffer() {
 int length = length();
 IntBuffer buf = IntBuffer.allocate(length);
 for (int i = 0;i < length;i++) {
  buf.put(getCodePointAt(i));
 }
 buf.flip();
 return buf;
}

代码示例来源:origin: io.termd/termd-core

if (action.length() <= buffer.length) {
 for (int i = 0;i < action.length();i++) {
  if (action.getCodePointAt(i) != buffer[i]) {
   continue next;
} else {
 for (int i = 0;i < buffer.length;i++) {
  if (action.getCodePointAt(i) != buffer[i]) {
   continue next;

代码示例来源:origin: termd/termd

if (event.getCodePointAt(0) == 4 && buffer.getSize() == 0) {
} else if (event.getCodePointAt(0) == 3) {
LineBuffer buf = buffer.copy();
for (int i = 0;i < event.length();i++) {
 int codePoint = event.getCodePointAt(i);
 try {
  buf.insert(codePoint);

代码示例来源:origin: io.termd/termd-core

if (event.getCodePointAt(0) == 4 && buffer.getSize() == 0) {
} else if (event.getCodePointAt(0) == 3) {
LineBuffer buf = buffer.copy();
for (int i = 0;i < event.length();i++) {
 int codePoint = event.getCodePointAt(i);
 try {
  buf.insert(codePoint);

代码示例来源:origin: com.alibaba.middleware/termd-core

@Test
public void testDecodeKeySeqPrefix() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('c').hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
 assertTrue(queue.hasNext());
 key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: termd/termd

@Test
public void testDecodeKeySeqPrefix() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('c').hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
 assertTrue(queue.hasNext());
 key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: io.termd/termd-core

@Test
public void testDecodeKeySeqPrefix() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('c').hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
 assertTrue(queue.hasNext());
 key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: com.alibaba.middleware/termd-core

@Test
public void testDecodeKeySeq() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('b', 'c').hasNext());
 FunctionEvent action = (FunctionEvent) queue.next();
 assertEquals("foo", action.name());
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: termd/termd

@Test
public void testDecodeKeySeq() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('b', 'c').hasNext());
 FunctionEvent action = (FunctionEvent) queue.next();
 assertEquals("foo", action.name());
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: io.termd/termd-core

@Test
public void testDecodeKeySeq() {
 EventQueue queue = new EventQueue(new Keymap(new ByteArrayInputStream("\"ab\":foo".getBytes())));
 assertFalse(queue.append('a').hasNext());
 assertTrue(queue.append('b', 'c').hasNext());
 FunctionEvent action = (FunctionEvent) queue.next();
 assertEquals("foo", action.name());
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('c', key.getCodePointAt(0));
 assertFalse(queue.hasNext());
}

代码示例来源:origin: termd/termd

@Test
public void testNotRecognizePredefinedKey() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append('a');
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
}

代码示例来源:origin: io.termd/termd-core

@Test
public void testNotRecognizePredefinedKey() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append('a');
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
}

代码示例来源:origin: com.alibaba.middleware/termd-core

@Test
public void testNotRecognizePredefinedKey() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append('a');
 assertTrue(queue.hasNext());
 KeyEvent key = (KeyEvent) queue.next();
 assertEquals(1, key.length());
 assertEquals('a', key.getCodePointAt(0));
}

代码示例来源:origin: com.alibaba.middleware/termd-core

@Test
public void testRecognizePredefinedKey1() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertTrue(queue.hasNext());
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent) queue.peek()).getCodePointAt(0));
 queue.append(65);
 assertTrue(queue.hasNext());
 assertEquals(Keys.UP, queue.next());
}

代码示例来源:origin: io.termd/termd-core

@Test
public void testRecognizePredefinedKey2() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent)queue.peek()).getCodePointAt(0));
 assertTrue(queue.hasNext());
 queue.append(66);
 assertTrue(queue.hasNext());
 assertEquals(Keys.DOWN, queue.next());
}

代码示例来源:origin: io.termd/termd-core

@Test
public void testRecognizePredefinedKey1() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertTrue(queue.hasNext());
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent) queue.peek()).getCodePointAt(0));
 queue.append(65);
 assertTrue(queue.hasNext());
 assertEquals(Keys.UP, queue.next());
}

代码示例来源:origin: com.alibaba.middleware/termd-core

@Test
public void testRecognizePredefinedKey2() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent)queue.peek()).getCodePointAt(0));
 assertTrue(queue.hasNext());
 queue.append(66);
 assertTrue(queue.hasNext());
 assertEquals(Keys.DOWN, queue.next());
}

代码示例来源:origin: termd/termd

@Test
public void testRecognizePredefinedKey1() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertTrue(queue.hasNext());
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent) queue.peek()).getCodePointAt(0));
 queue.append(65);
 assertTrue(queue.hasNext());
 assertEquals(Keys.UP, queue.next());
}

代码示例来源:origin: termd/termd

@Test
public void testRecognizePredefinedKey2() {
 EventQueue queue = new EventQueue(new Keymap());
 queue.append(27, 91);
 assertEquals(1, ((KeyEvent) queue.peek()).length());
 assertEquals(27, ((KeyEvent)queue.peek()).getCodePointAt(0));
 assertTrue(queue.hasNext());
 queue.append(66);
 assertTrue(queue.hasNext());
 assertEquals(Keys.DOWN, queue.next());
}

相关文章