KeyboardPopupSwitcherTestHid.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
@Override
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e) {
    boolean isCtrl = e.getModifiers() == InputEvent.CTRL_MASK;
    boolean isCtrlShift = e.getModifiers() == (InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK);
    boolean doPopup = (e.getKeyCode() == KeyEvent.VK_TAB) &&
            (isCtrl || isCtrlShift);
    if (doPopup && !KeyboardPopupSwitcher.isShown()) {
        // create popup with our SwitcherTable
        KeyboardPopupSwitcher.showPopup(new Model( items1, items2, true ), KeyEvent.VK_CONTROL, e.getKeyCode(), (e.getModifiers() & InputEvent.SHIFT_MASK)==0);
        return true;
    }
    if( KeyboardPopupSwitcher.isShown() ) {
        KeyboardPopupSwitcher.doProcessShortcut( e );
    }

    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号