當前位置: 首頁>>代碼示例>>Java>>正文


Java GLFW.GLFW_MOUSE_BUTTON_LEFT屬性代碼示例

本文整理匯總了Java中org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java GLFW.GLFW_MOUSE_BUTTON_LEFT屬性的具體用法?Java GLFW.GLFW_MOUSE_BUTTON_LEFT怎麽用?Java GLFW.GLFW_MOUSE_BUTTON_LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.lwjgl.glfw.GLFW的用法示例。


在下文中一共展示了GLFW.GLFW_MOUSE_BUTTON_LEFT屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onMouseButton

@Override
public void onMouseButton(int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS) return;
    
    if (connectJack != null)
    {
        if (button == GLFW.GLFW_MOUSE_BUTTON_RIGHT || button == GLFW.GLFW_MOUSE_BUTTON_LEFT)
        {
            if (node.isLast()) node.getWire().connectOut((InputJack)connectJack);
            else if (node.isFirst()) node.getWire().connectIn((OutputJack)connectJack);
            Main.instance().setDefaultState();
        }
    }
    else
    {
        if (button == GLFW.GLFW_MOUSE_BUTTON_RIGHT) Main.instance().setDefaultState();
        else if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT && !node.isCorner())
            node = node.makeCorner();
    }
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:21,代碼來源:WireDragState.java

示例2: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE)
        MidiSeqScreen.this.onMouseButton(query, button, action, mods);
    
    if (action != GLFW.GLFW_PRESS) return;
    
    if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT) Main.instance().setState(drag());
    else if (button == GLFW.GLFW_MOUSE_BUTTON_RIGHT) track.notes.remove(note);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:11,代碼來源:MidiSeqScreen.java

示例3: drag

@Override
NoteDrag drag()
{
    DSPUtil.midiOn(midiOut, note.midi);
    
    return new NoteDrag()
    {
        @Override
        public void update()
        {
            Vec2 mouse = camera.toWorld(getMouse());
            mouse.x += offset.x;
            long length = note.end - note.start;
            note.start = seq.snapToGrid(mouse.x);
            note.end = note.start + length;

            int oldMidi = note.midi;
            note.midi = DSPUtil.clampMidi(Util.floor(mouse.y));

            if (oldMidi != note.midi)
            {
                DSPUtil.midiOff(midiOut, oldMidi);
                DSPUtil.midiOn(midiOut, note.midi);
            }
        }
        
        @Override
        public void onMouseButton(int button, int action, int mods)
        {
            if (action == GLFW.GLFW_RELEASE && button == GLFW.GLFW_MOUSE_BUTTON_LEFT)
            {
                Main.instance().setDefaultState();
                DSPUtil.midiOff(midiOut, note.midi);
            }
        }
    };
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:37,代碼來源:MidiSeqScreen.java

示例4: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS) return;
    
    if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT)
    {
        Vec2 p = camera.toWorld(seq.getMouse());
        int newPos = Math.round(p.x*Main.SAMPLE_RATE);
        SongProperties props = seq.getProperties();
        props.playStartTime += props.position - newPos;
        props.position = newPos;
    }
    else if (button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE) camera.drag(true, false);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:15,代碼來源:MidiSeqTimeline.java

示例5: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_LEFT)
    {
        return;
    }
    setValue(!value);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:9,代碼來源:RadioButtons.java

示例6: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_LEFT) return;
    
    if (!hasWire())
    {
        new Wire().connectOut(this);
        Wire wire = getWire();
        WireNode dragNode = wire.getFirst();
        dragNode.pos.set(getWirePos());
        Main.instance().addWire(wire);
        Main.instance().setState(new WireDragState(dragNode));
    }
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:15,代碼來源:InputJack.java

示例7: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_LEFT) return;
    
    if (!hasWire())
    {
        new Wire().connectIn(this);
        Wire wire = getWire();
        WireNode dragNode = wire.getLast();
        dragNode.pos.set(getWirePos());
        Main.instance().addWire(wire);
        Main.instance().setState(new WireDragState(dragNode));
    }
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:15,代碼來源:OutputJack.java

示例8: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_LEFT) return;
    
    if (top) setScrollPos(scrollPos - SCROLL_RATE);
    else setScrollPos(scrollPos + SCROLL_RATE);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:8,代碼來源:ScrollBox.java

示例9: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_LEFT) return;
    
    setValue(!value);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:7,代碼來源:ToggleButton.java

示例10: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action == GLFW.GLFW_PRESS && button == GLFW.GLFW_MOUSE_BUTTON_LEFT)
        setValue(option);
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:6,代碼來源:ListBox.java

示例11: onMouseButton

@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
    if (action == GLFW.GLFW_PRESS && button == GLFW.GLFW_MOUSE_BUTTON_LEFT) click();
}
 
開發者ID:SmashMaster,項目名稱:KraftigAudio,代碼行數:5,代碼來源:Button.java


注:本文中的org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_LEFT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。