本文整理汇总了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();
}
}
示例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);
}
示例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);
}
}
};
}
示例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);
}
示例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);
}
示例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));
}
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}