本文整理汇总了Java中org.lwjgl.glfw.GLFW.GLFW_PRESS属性的典型用法代码示例。如果您正苦于以下问题:Java GLFW.GLFW_PRESS属性的具体用法?Java GLFW.GLFW_PRESS怎么用?Java GLFW.GLFW_PRESS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lwjgl.glfw.GLFW
的用法示例。
在下文中一共展示了GLFW.GLFW_PRESS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKey
@Override
public void onKey(int key, int action, int mods)
{
if (action == GLFW.GLFW_PRESS && key == GLFW.GLFW_KEY_TAB && menu == null)
{
displayMouse = !displayMouse;
boolean display = displayMouse();
mouse.setGrabbed(!display);
if (!display) mouse.setPosDirty();
Vec2i res = getResolution();
mouse.setPos(res.x/2.0f, res.y/2.0f);
}
interactionState.onKey(key, action, mods);
}
示例2: 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();
}
}
示例3: handleEvents
@Override
public void handleEvents(List<Event> events) {
for (Event e : events) {
if (e.type == Event.Type.KEY_INPUT) {
KeyInputEvent evt = (KeyInputEvent) e;
if (evt.action == GLFW.GLFW_PRESS) {
if (evt.mods == GLFW.GLFW_MOD_CONTROL && evt.key == GLFW.GLFW_KEY_ENTER) { // command
// mode
java.lang.System.out.print("Enter your command: ");
String commandLine = consoleScanner.nextLine();
String command = commandLine;
if (commandLine.indexOf(' ') != -1)
commandLine.substring(0, commandLine.indexOf(' '));
if (command.equals("load")) {
game.createEvent(new LoadSceneEvent("default"));// TODO
// change
// default
// to
// last
// (or
// sth).
} else if (command.equals("save")) {
game.createEvent(new Event(Event.Type.SAVE));
} else if (command.equals("exit")) {
game.createEvent(new Event(Event.Type.EXIT));
} else {// unknown command
Logger.warn("Unknown command " + command + "");
}
}
}
}
}
}
示例4: invoke
@Override
public void invoke(long window, int keycode, int scancode, int action, int mods) {
// If the key was pressed
if(action == GLFW.GLFW_PRESS) {
keyPressed(keycode);
// If the key was released
} else if (action == GLFW.GLFW_RELEASE){
keyReleased(keycode);
}
}
示例5: 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);
}
示例6: 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);
}
示例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;
}
setValue(!value);
}
示例8: GetKey
public static boolean GetKey(int keyCode)
{
try{
return GLFW.glfwGetKey(Window.CurrentWindow(), keyCode) == GLFW.GLFW_PRESS;//Keyboard.isKeyDown(keyCode);
} catch(Exception e)
{
return false;
}
}
示例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;
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));
}
}
示例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) return;
if (top) setScrollPos(scrollPos - SCROLL_RATE);
else setScrollPos(scrollPos + SCROLL_RATE);
}
示例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) return;
setValue(!value);
}
示例12: onMouseButton
@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
//Panel drag.
if (action == GLFW.GLFW_PRESS && button == GLFW.GLFW_MOUSE_BUTTON_RIGHT)
Main.instance().setState(new PanelDragState(this));
}
示例13: onMouseButton
@Override
public void onMouseButton(int button, int action, int mods)
{
if (action != GLFW.GLFW_PRESS || button != GLFW.GLFW_MOUSE_BUTTON_RIGHT) return;
panel.dragged = false;
Main.instance().setDefaultState();
}
示例14: onMouseButton
@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
if (action == GLFW.GLFW_PRESS && button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE) camera.drag(false, true);
}
示例15: onMouseButton
@Override
public void onMouseButton(FocusQuery query, int button, int action, int mods)
{
if (action == GLFW.GLFW_PRESS && button == GLFW.GLFW_MOUSE_BUTTON_RIGHT)
Main.instance().setState(new WireDragState(this));
}