org.eclipse.swt.events.KeyListener类的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(193)

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

KeyListener介绍

[英]Classes which implement this interface provide methods that deal with the events that are generated as keys are pressed on the system keyboard.

After creating an instance of a class that implements this interface it can be added to a control using the addKeyListener method and removed using the removeKeyListener method. When a key is pressed or released, the appropriate method will be invoked.
[中]实现此接口的类提供了处理在系统键盘上按下键时生成的事件的方法。
创建实现此接口的类的实例后,可以使用addKeyListener方法将其添加到控件中,并使用removeKeyListener方法将其删除。当按下或释放某个键时,将调用相应的方法。

代码示例

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

@Override
public void keyPressed(KeyEvent e) {
  if (e.doit) {
    oldKeyListener.keyPressed(e);
  }
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

@Override
  public void keyReleased(KeyEvent e) {
    if (e.doit) {
      oldKeyListener.keyReleased(e);
    }
  }
});

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

fFilterText.setLayoutData(data);
fFilterText.addKeyListener(KeyListener.keyPressedAdapter(e -> {
  switch (e.keyCode) {
  case SWT.CR:

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

GridData gd = (GridData) table.getLayoutData();
gd.widthHint = 250;
table.addKeyListener(KeyListener.keyReleasedAdapter(e -> {
  if (e.stateMask == SWT.NONE && e.keyCode == SWT.DEL) {
    removeLocation();

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

gd.heightHint = 200;
tree.setLayoutData(gd);
tree.addKeyListener(KeyListener.keyPressedAdapter(e -> {
  if (e.character == SWT.DEL && e.stateMask == 0) {
    handleRemove(fViewer.getStructuredSelection());

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

Table table = new Table(lcomp, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | SWT.CHECK);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.addKeyListener(KeyListener.keyReleasedAdapter(e -> {
  if (e.stateMask == SWT.NONE && e.keyCode == SWT.DEL) {
    doRemove();

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

iter.next().keyPressed(keyEvent);

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void keyReleased(KeyEvent event) {
  KeyListener[] listeners = tv.getKeyListeners();
  for (KeyListener l : listeners) {
    l.keyReleased(event);
    if (!event.doit) {
      return;
    }
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

updatejob.schedule();
});
text.addKeyListener(KeyListener.keyPressedAdapter(e -> {
  if (e.keyCode == SWT.ARROW_DOWN) {
    if (tableviewer != null) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

keyListener.keyPressed(keyEvent);

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

updatejob.schedule();
});
text.addKeyListener(KeyListener.keyPressedAdapter(e -> {
  if (e.keyCode == SWT.ARROW_DOWN) {
    if (tableviewer != null) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: BiglySoftware/BiglyBT

l.keyPressed(event);
if (!event.doit) {
  lCancelSelectionTriggeredOn = SystemTime.getCurrentTime();

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

table.addKeyListener(KeyListener.keyPressedAdapter(event -> {
  if (event.character == SWT.DEL && event.stateMask == 0) {
    doRemove();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

((KeyListener) eventListener).keyPressed(event);
e.doit = event.doit;
break;
((KeyListener) eventListener).keyReleased(event);
e.doit = event.doit;
break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

table.addKeyListener(KeyListener.keyPressedAdapter(e -> {
  switch (e.keyCode) {
  case SWT.ESC:

相关文章