本文整理匯總了Java中org.lwjgl.input.Keyboard.KEY_LSHIFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Keyboard.KEY_LSHIFT屬性的具體用法?Java Keyboard.KEY_LSHIFT怎麽用?Java Keyboard.KEY_LSHIFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.lwjgl.input.Keyboard
的用法示例。
在下文中一共展示了Keyboard.KEY_LSHIFT屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: keyPress
@Override
public void keyPress(int key, char keyChar) {
if (this.extended)
this.componentList.keyPress(key, keyChar);
if (this.binding) {
if (key != Keyboard.KEY_NONE && key != Keyboard.KEY_ESCAPE && key != Keyboard.KEY_LSHIFT && key != Keyboard.KEY_GRAVE && key != Keyboard.KEY_RSHIFT) {
this.mod.setKeybind(key);
new Thread(() -> {
if (this.title == null || mod == null) return;
this.title = "Bound to " + Keyboard.getKeyName(key);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
if (this.title == null || mod == null) return;
this.title = mod.getId();
}).start();
this.binding = false;
}
}
}
示例2: fixKeysHack
/**
* A hack to fix the fact that AWT left and right control and shift keys
* have no distinction
*
* @param awtKeyCode
* the key code to check if it needs a conversion
* @return The hacked key code
*/
public static int fixKeysHack(int keyCode)
{
if (keyCode == Keyboard.KEY_LSHIFT)
return Keyboard.KEY_RSHIFT;
if (keyCode == Keyboard.KEY_LCONTROL)
return Keyboard.KEY_RCONTROL;
return keyCode;
}