本文整理汇总了Java中com.badlogic.gdx.Input.Keys.COMMA属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.COMMA属性的具体用法?Java Keys.COMMA怎么用?Java Keys.COMMA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.COMMA属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setKeyAssign
public void setKeyAssign(Mode mode, boolean enable) {
switch (mode) {
case BEAT_5K:
case BEAT_7K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT };
break;
case BEAT_10K:
case BEAT_14K:
default:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
break;
case POPN_5K:
case POPN_9K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.G, Keys.B };
break;
case KEYBOARD_24K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
keys = Arrays.copyOf(keys, 26);
break;
case KEYBOARD_24K_DOUBLE:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
keys = Arrays.copyOf(keys, 52);
break;
}
if(!enable) {
Arrays.fill(keys, -1);
}
start = Keys.Q;
select = Keys.W;
}
示例2: loadDefault
public void loadDefault() {
//player
forward = Keys.W;
right = Keys.D;
left = Keys.A;
back = Keys.S;
shoot = Keys.SPACE;
changeVehicle = Keys.G;
land = Keys.T;
//ui
toggleHUD = Keys.H;
toggleEdgeMap = Keys.M;
toggleSpaceMap = Keys.P;
//screen
fullscreen = Keys.F11;
vsync = Keys.F8;
zoomOut = Keys.MINUS;
zoomIn = Keys.EQUALS;
resetZoom = Keys.PERIOD;
zoomCharacter = Keys.SLASH;
zoomSpace = Keys.COMMA;
rotateLeft = Keys.LEFT_BRACKET;
rotateRight = Keys.RIGHT_BRACKET;
//debug menu
toggleDebug = Keys.F3;
togglePos = Keys.NUMPAD_0;
toggleComponents = Keys.NUMPAD_1;
toggleBounds = Keys.NUMPAD_2;
toggleFPS = Keys.NUMPAD_3;
toggleOrbit = Keys.NUMPAD_4;
toggleVector = Keys.NUMPAD_5;
toggleMenu = Keys.NUMPAD_9;
}
示例3: keyPressed
@Override
public void keyPressed(int key)
{
// if this input box is NOT selected, just do nothing
if (!_selected || !_state) return;
switch (key)
{
case Keys.RIGHT:
++_curserPos;
_curserPos %= (_text.length() + 1);
break;
case Keys.LEFT:
_curserPos--;
if (_curserPos < 0) _curserPos = _text.length();
break;
case Keys.SHIFT_LEFT:
case Keys.SHIFT_RIGHT:
_shift = true;
break;
case Keys.SPACE:
charTyped(' ');
break;
case Keys.PERIOD:
charTyped('.');
break;
case Keys.COMMA:
charTyped(',');
break;
case Keys.SEMICOLON:
charTyped(';');
break;
case Keys.COLON:
charTyped(':');
break;
case Keys.MINUS:
charTyped('-');
break;
case Keys.BACKSPACE:
if (_curserPos > 0)
{
_text = _text.substring(0, _curserPos - 1) + _text.substring(_curserPos, _text.length());
_curserPos--;
}
break;
case Keys.ENTER:
case Keys.ESCAPE:
METRO.__setSelectedInput(null);
break;
}
// for ranges:
if (key >= Keys.A && key <= Keys.Z)
{
charTyped(_shift ? (char) (36 + key) : (char) (68 + key));
}
else if (key >= Keys.NUM_0 && key <= Keys.NUM_9)
{
charTyped((char) (key + 41));
}
// if length of string in pixel is greater than the width of the field, delete last added character
if (Draw.getStringSize(_text).width > _area.width)
{
_text = _text.substring(0, _curserPos - 1) + _text.substring(_curserPos, _text.length());
_curserPos--;
}
}
示例4: keyDown
public boolean keyDown(int k) {
if(mode==0){
if(k == Keys.W || k == Keys.UP) MyInput.setKey(Input.UP, true);
if(k == Keys.A || k == Keys.LEFT) MyInput.setKey(Input.LEFT, true);
if(k == Keys.S || k == Keys.DOWN) MyInput.setKey(Input.DOWN, true);
if(k == Keys.D || k == Keys.RIGHT) MyInput.setKey(Input.RIGHT, true);
if(k == Keys.SPACE) MyInput.setKey(Input.JUMP, true);
if(k == Keys.Q || k == Keys.CONTROL_RIGHT) MyInput.setKey(Input.INTERACT, true);
if(k == Keys.E || k == Keys.NUMPAD_0) MyInput.setKey(Input.ATTACK, true);
if(k == Keys.SHIFT_LEFT) MyInput.setKey(Input.SPECIAL, true);
if(k == Keys.CONTROL_LEFT || k == Keys.Z) MyInput.setKey(Input.RUN, true);
if(k == Keys.R || k == Keys.NUMPAD_1) MyInput.setKey(Input.USE, true);
if(k == Keys.ESCAPE) MyInput.setKey(Input.PAUSE, true);
if(k == Keys.ENTER) MyInput.setKey(Input.ENTER, true);
if(k == Keys.TAB) MyInput.setKey(Input.RESPAWN, true);
if(k == Keys.NUMPAD_8 || k == Keys.U) MyInput.setKey(Input.DEBUG_UP, true);
if(k == Keys.NUMPAD_2 || k == Keys.J) MyInput.setKey(Input.DEBUG_DOWN, true);
if(k == Keys.NUMPAD_4 || k == Keys.I) MyInput.setKey(Input.DEBUG_LEFT, true);
if(k == Keys.NUMPAD_6 || k == Keys.O) MyInput.setKey(Input.DEBUG_RIGHT, true);
if(k == Keys.NUMPAD_7 || k == Keys.LEFT_BRACKET) MyInput.setKey(Input.DEBUG_LEFT2, true);
if(k == Keys.NUMPAD_9 || k == Keys.RIGHT_BRACKET) MyInput.setKey(Input.DEBUG_RIGHT2, true);
if(k == Keys.M) MyInput.setKey(Input.DEBUG_CENTER, true);
if(k == Keys.F1) MyInput.setKey(Input.COLLISION, true);
if(k == Keys.F2) MyInput.setKey(Input.LIGHTS, true);
if(k == Keys.F3) MyInput.setKey(Input.DEBUG_TEXT, true);
if(k == Keys.F4) MyInput.setKey(Input.RENDER, true);
if(k == Keys.EQUALS) MyInput.setKey(Input.ZOOM_IN, true);
if(k == Keys.MINUS) MyInput.setKey(Input.ZOOM_OUT, true);
} else {
// System.out.println(k+":"+Keys.toString(k));
boolean entered = false;
if(k == Keys.ESCAPE){ entered=true; MyInput.setKey(Input.PAUSE, true); }
if(k == Keys.SPACE){ entered=true; MyInput.setKey(Input.JUMP, true); }
if(k == Keys.ENTER){ entered=true; MyInput.setKey(Input.ENTER, true); }
if(Keys.toString(k).toLowerCase().equals("delete")){ entered=true; MyInput.setKey(Input.DOWN, true); }
if(k == Keys.LEFT){ entered=true; MyInput.setKey(Input.LEFT, true); }
if(k == Keys.RIGHT){ entered=true; MyInput.setKey(Input.RIGHT, true); }
if(k == Keys.HOME){ entered=true; Game.inputIndex = 0;}
if(k == Keys.END){ entered=true; Game.inputIndex = Game.getInput().length() - 1; }
if(k == Keys.SHIFT_LEFT || k == Keys.SHIFT_RIGHT){ entered=true; MyInput.setKey(Input.UP, true); }
if(MyInput.isDown(Input.UP)){
if(k == Keys.NUM_1){ entered = true; Game.addInputChar("!"); }
if(k == Keys.NUM_2){ entered = true; Game.addInputChar("@"); }
if(k == Keys.NUM_3){ entered = true; Game.addInputChar("#"); }
if(k == Keys.NUM_4){ entered = true; Game.addInputChar("$"); }
if(k == Keys.NUM_5){ entered = true; Game.addInputChar("%"); }
if(k == Keys.NUM_6){ entered = true; Game.addInputChar("^"); }
if(k == Keys.NUM_7){ entered = true; Game.addInputChar("&"); }
if(k == Keys.NUM_8){ entered = true; Game.addInputChar("*"); }
if(k == Keys.NUM_9){ entered = true; Game.addInputChar("("); }
if(k == Keys.NUM_0){ entered = true; Game.addInputChar(")"); }
if(k == Keys.EQUALS){ entered = true; Game.addInputChar("+"); }
if(k == Keys.MINUS){ entered = true; Game.addInputChar("_"); }
if(k == Keys.PERIOD){ entered = true; Game.addInputChar(">"); }
if(k == Keys.COMMA){ entered = true; Game.addInputChar("<"); }
if(k == Keys.SLASH){ entered = true; Game.addInputChar("?"); }
}
if(k == Keys.NUMPAD_1){ k = Keys.NUM_1; }
if(k == Keys.NUMPAD_2){ k = Keys.NUM_2; }
if(k == Keys.NUMPAD_3){ k = Keys.NUM_3; }
if(k == Keys.NUMPAD_4){ k = Keys.NUM_4; }
if(k == Keys.NUMPAD_5){ k = Keys.NUM_5; }
if(k == Keys.NUMPAD_6){ k = Keys.NUM_6; }
if(k == Keys.NUMPAD_7){ k = Keys.NUM_7; }
if(k == Keys.NUMPAD_8){ k = Keys.NUM_8; }
if(k == Keys.NUMPAD_9){ k = Keys.NUM_9; }
if(k == Keys.NUMPAD_0){ k = Keys.NUM_0; }
if(!entered && !ignoreKeys.contains(k, false))
if(MyInput.isDown(Input.UP) || MyInput.isCaps)
Game.addInputChar(Keys.toString(k));
else
Game.addInputChar(Keys.toString(k).toLowerCase());
}
return true;
}