本文整理汇总了Java中com.google.gwt.event.dom.client.MouseUpEvent.isControlKeyDown方法的典型用法代码示例。如果您正苦于以下问题:Java MouseUpEvent.isControlKeyDown方法的具体用法?Java MouseUpEvent.isControlKeyDown怎么用?Java MouseUpEvent.isControlKeyDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.MouseUpEvent
的用法示例。
在下文中一共展示了MouseUpEvent.isControlKeyDown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseUp
import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
/**
* First mouse button: publish a toggle event on the selection topic for the referenced MapWidget. Second mouse
* button opens a menu.
*
* @param event
* event
*/
@Override
public void onMouseUp(MouseUpEvent event) {
// handle click if any?
if (dragging) {
// shift or CTRL is used when depressed either at beginning or end:
shiftOrCtrl = (event.isShiftKeyDown() || event.isControlKeyDown());
if (timestamp + clickTimeout > new Date().getTime()
&& (bounds.getWidth() < pixelTolerance || bounds.getHeight() < pixelTolerance)) {
stopDragging();
// click behavior instead of drag
ToggleSelectionAction action = new ToggleSelectionAction(mapWidget, priorityToSelectedLayer,
pixelTolerance);
action.toggle(getScreenPosition(event), !shiftOrCtrl);
return;
}
}
// normal "rectangle" handling
super.onMouseUp(event);
}
示例2: onMouseUp
import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent p_event)
{
p_event.preventDefault();
UserAction userAction = UserAction.Primary;
if (p_event.isControlKeyDown() || p_event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
userAction = UserAction.Secondary;
}
onUp(userAction, p_event.getX(), p_event.getY());
}