com.google.gwt.user.client.Event.getCtrlKey()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(122)

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

Event.getCtrlKey介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets whether the CTRL key was depressed when the given event occurred.
 * 
 * @param evt the event to be tested
 * @return <code>true</code> if CTRL was depressed when the event occurred
 * @deprecated Use {@link Event#getCtrlKey()} instead.
 */
@Deprecated
public static boolean eventGetCtrlKey(Event evt) {
 return evt.getCtrlKey();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
 public boolean handleAsClick(Event event) {
  int mouseButtons = event.getButton();
  boolean ctrl = event.getCtrlKey();
  boolean shift = event.getShiftKey();
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;
  boolean modifiers;
  
  if (ctrlisModifier) {
   modifiers = shift || ctrl;
  } else {
   modifiers = shift;  
  }

  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the keyboard modifiers associated with a DOMEvent.
 * 
 * @param event the event.
 * @return the modifiers as defined in {@link KeyboardListener}.
 */
public static int getKeyboardModifiers(Event event) {
 return (event.getShiftKey() ? KeyboardListener.MODIFIER_SHIFT : 0)
   | (event.getMetaKey() ? KeyboardListener.MODIFIER_META : 0)
   | (event.getCtrlKey() ? KeyboardListener.MODIFIER_CTRL : 0)
   | (event.getAltKey() ? KeyboardListener.MODIFIER_ALT : 0);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
 public boolean handleAsClick(Event event) {
  int mouseButtons = event.getButton();
  boolean alt = event.getAltKey();
  boolean ctrl = event.getCtrlKey();
  boolean meta = event.getMetaKey();
  boolean shift = event.getShiftKey();
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;

  boolean modifiers = alt || ctrl || meta;
  if (shiftIsModifier) {
   modifiers |= shift;
  }
  
  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Default version, useful for Firefox. Don't fire if it's a rightclick,
  * middleclick, or if any modifiers are held down.
  */
 public boolean handleAsClick(Event event) {   
  int mouseButtons = event.getButton();
  boolean alt = event.getAltKey();
  boolean ctrl = event.getCtrlKey();
  boolean meta = event.getMetaKey();
  boolean shift = event.getShiftKey();    
  boolean modifiers = alt || ctrl || meta || shift;
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;

  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: pt.ist/svgwt

/**
 * Returns <code>true</code> if the control key is pressed.
 * 
 * @return the control key state
 */
public boolean isControlDown() {
  return _event.getCtrlKey();
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Gets whether the CTRL key was depressed when the given event occurred.
 * 
 * @param evt the event to be tested
 * @return <code>true</code> if CTRL was depressed when the event occurred
 * @deprecated Use {@link Event#getCtrlKey()} instead.
 */
@Deprecated
public static boolean eventGetCtrlKey(Event evt) {
 return evt.getCtrlKey();
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Gets whether the CTRL key was depressed when the given event occurred.
 * 
 * @param evt the event to be tested
 * @return <code>true</code> if CTRL was depressed when the event occurred
 * @deprecated Use {@link Event#getCtrlKey()} instead.
 */
@Deprecated
public static boolean eventGetCtrlKey(Event evt) {
 return evt.getCtrlKey();
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

@Override
 public boolean handleAsClick(Event event) {
  int mouseButtons = event.getButton();
  boolean ctrl = event.getCtrlKey();
  boolean shift = event.getShiftKey();
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;
  boolean modifiers;
  
  if (ctrlisModifier) {
   modifiers = shift || ctrl;
  } else {
   modifiers = shift;  
  }

  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Gets the keyboard modifiers associated with a DOMEvent.
 * 
 * @param event the event.
 * @return the modifiers as defined in {@link KeyboardListener}.
 */
public static int getKeyboardModifiers(Event event) {
 return (event.getShiftKey() ? KeyboardListener.MODIFIER_SHIFT : 0)
   | (event.getMetaKey() ? KeyboardListener.MODIFIER_META : 0)
   | (event.getCtrlKey() ? KeyboardListener.MODIFIER_CTRL : 0)
   | (event.getAltKey() ? KeyboardListener.MODIFIER_ALT : 0);
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Gets the keyboard modifiers associated with a DOMEvent.
 * 
 * @param event the event.
 * @return the modifiers as defined in {@link KeyboardListener}.
 */
public static int getKeyboardModifiers(Event event) {
 return (event.getShiftKey() ? KeyboardListener.MODIFIER_SHIFT : 0)
   | (event.getMetaKey() ? KeyboardListener.MODIFIER_META : 0)
   | (event.getCtrlKey() ? KeyboardListener.MODIFIER_CTRL : 0)
   | (event.getAltKey() ? KeyboardListener.MODIFIER_ALT : 0);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

public static boolean isAnyModifierKeyPressed(Event event) {
  return (event.getShiftKey()
      || event.getAltKey()
      || event.getCtrlKey()
      || event.getMetaKey());
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

protected boolean isShortcut(Event event) {
    return event.getShiftKey() || event.getAltKey() || event.getCtrlKey() || event.getMetaKey();
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

protected boolean isShortcut(Event event) {
    return event.getShiftKey() || event.getAltKey() || event.getCtrlKey() || event.getMetaKey();
  }
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
  public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);
    if (event.getCtrlKey() && event.getTypeInt() == Event.ONCLICK && getValue()) {
      setValue(false, true);
    }
  }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
  * Default version, useful for Firefox. Don't fire if it's a rightclick,
  * middleclick, or if any modifiers are held down.
  */
 public boolean handleAsClick(Event event) {   
  int mouseButtons = event.getButton();
  boolean alt = event.getAltKey();
  boolean ctrl = event.getCtrlKey();
  boolean meta = event.getMetaKey();
  boolean shift = event.getShiftKey();    
  boolean modifiers = alt || ctrl || meta || shift;
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;

  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
 public boolean handleAsClick(Event event) {
  int mouseButtons = event.getButton();
  boolean alt = event.getAltKey();
  boolean ctrl = event.getCtrlKey();
  boolean meta = event.getMetaKey();
  boolean shift = event.getShiftKey();
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;

  boolean modifiers = alt || ctrl || meta;
  if (shiftIsModifier) {
   modifiers |= shift;
  }
  
  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
  * Default version, useful for Firefox. Don't fire if it's a rightclick,
  * middleclick, or if any modifiers are held down.
  */
 public boolean handleAsClick(Event event) {   
  int mouseButtons = event.getButton();
  boolean alt = event.getAltKey();
  boolean ctrl = event.getCtrlKey();
  boolean meta = event.getMetaKey();
  boolean shift = event.getShiftKey();    
  boolean modifiers = alt || ctrl || meta || shift;
  boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
  boolean right = mouseButtons == Event.BUTTON_RIGHT;

  return !modifiers && !middle && !right;
 }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

@Override
public void onBrowserEvent(Event event) {
  int type = DOM.eventGetType(event);
  if (type == Event.ONKEYDOWN
      && event.getKeyCode() == KeyCodes.KEY_ENTER
      && !event.getAltKey()
      && !event.getShiftKey()
      && !event.getCtrlKey()) {
    event.stopPropagation();
    return;
  }
  super.onBrowserEvent(event);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
protected void onBrowserEvent2(Event event) {
  // Enable multiple selection only when Control/Shift key is pressed
  mousePosition[0] = event.getClientX();
  mousePosition[1] = event.getClientY();
  if (BrowserEvents.CLICK.equals(event.getType())) {
    selectionModel.asMultiSelectionModel().setMultiSelectEnabled(event.getCtrlKey());
    selectionModel.asMultiSelectionModel().setMultiRangeSelectEnabled(event.getShiftKey());
  }
  // Remove focus from the table so refreshes won't try to focus on the
  // selected row. This is important when the user has scrolled the selected
  // row off the screen, we don't want the browser to scroll back.
  table.setFocus(false);
  super.onBrowserEvent2(event);
}

相关文章