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

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

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

Event.getMetaKey介绍

暂无

代码示例

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

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

代码示例来源: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

/**
  * 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.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: pt.ist/svgwt

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

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

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

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

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

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

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

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

case Event.ONKEYUP:
 if (event.getAltKey() || event.getMetaKey()) {
  super.onBrowserEvent(event);
  return;

代码示例来源: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: 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.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: com.vaadin.external.gwt/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: 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: ArcBees/gwtchosen

protected void resultSelect(Event e) {
  if (resultHighlight != null) {
    GQuery high = resultHighlight;
    resultClearHighlight();
    resultDeactivate(high, true);
    high.addClass(css.resultSelected());
    OptionItem item = getOptionItem(high);
    item.setSelected(true);
    OptionElement option = selectElement.getOptions().getItem(item.getOptionsIndex());
    if (option != null) {
      option.setSelected(true);
    }
    addChoice(item);
    winnowResultsClear();
    String oldValue = getCurrentValue();
    String newValue = item.getValue();
    selectedValues.add(newValue);
    onResultSelected(item, newValue, oldValue, e.getMetaKey());
    searchFieldScale(fWidth);
  }
}

代码示例来源:origin: com.arcbees/gwtchosen

protected void resultSelect(Event e) {
  if (resultHighlight != null) {
    GQuery high = resultHighlight;
    resultClearHighlight();
    resultDeactivate(high, true);
    high.addClass(css.resultSelected());
    OptionItem item = getOptionItem(high);
    item.setSelected(true);
    OptionElement option = selectElement.getOptions().getItem(item.getOptionsIndex());
    if (option != null) {
      option.setSelected(true);
    }
    addChoice(item);
    winnowResultsClear();
    String oldValue = getCurrentValue();
    String newValue = item.getValue();
    selectedValues.add(newValue);
    onResultSelected(item, newValue, oldValue, e.getMetaKey());
    searchFieldScale(fWidth);
  }
}

代码示例来源:origin: com.github.jdramaix/gwtchosen

if (!e.getMetaKey() || !isMultiple) {
  resultsHide();

相关文章