本文整理汇总了Java中com.googlecode.lanterna.input.Key.Kind方法的典型用法代码示例。如果您正苦于以下问题:Java Key.Kind方法的具体用法?Java Key.Kind怎么用?Java Key.Kind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.lanterna.input.Key
的用法示例。
在下文中一共展示了Key.Kind方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleInput
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void handleInput(Key key) {
////// The part below handles everything controlled by hotkeys and should not be changed (unless a bug is found)
if (currentInputHandler == null){
return;
}
Key.Kind keyKind = key.getKind();
if (keyKind == Key.Kind.ArrowDown || keyKind == Key.Kind.ArrowLeft || keyKind == Key.Kind.ArrowRight || keyKind == Key.Kind.ArrowUp) {
currentInputHandler.arrowPressed(keyKind);
}
else if (keyKind == Key.Kind.Enter){
currentInputHandler.enterPressed();
}
else if (keyKind == Key.Kind.Backspace || keyKind == Key.Kind.Delete || keyKind == Key.Kind.End || keyKind == Key.Kind.Home || keyKind == Key.Kind.Insert || keyKind == Key.Kind.PageUp || keyKind == Key.Kind.PageDown || keyKind == Key.Kind.Tab || keyKind == Key.Kind.Escape){
currentInputHandler.specialKeyPressed(keyKind);
}
else if (keyKind == Kind.NormalKey){
currentInputHandler.normalKeyPressed(key.getCharacter());
}
else if (keyKind == Kind.F1 || keyKind == Kind.F2 || keyKind == Kind.F3 || keyKind == Kind.F4 || keyKind == Kind.F5 || keyKind == Kind.F6 || keyKind == Kind.F7 || keyKind == Kind.F8 || keyKind == Kind.F9 || keyKind == Kind.F10 || keyKind == Kind.F11 || keyKind == Kind.F12){
currentInputHandler.FbuttonPressed(keyKind);
}
}
示例2: arrowPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void arrowPressed(Key.Kind keykind) {
if (keykind == Key.Kind.ArrowDown) {
this.dialog.lowerDraw();
}
else if (keykind == Key.Kind.ArrowUp) {
this.dialog.upperDraw();
}
}
示例3: arrowPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void arrowPressed(Key.Kind keykind) {
if (keykind == Key.Kind.ArrowUp) {
this.menu.getActivatedRow().changeSelectionUp();
}
else if (keykind == Key.Kind.ArrowDown) {
this.menu.getActivatedRow().changeSelectionDown();
}
else if (keykind == Key.Kind.ArrowLeft) {
this.menu.changeSelectionLeft();
}
else if (keykind == Key.Kind.ArrowRight) {
this.menu.changeSelectionRight();
}
}
示例4: specialKeyPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void specialKeyPressed(Key.Kind keykind){
if (keykind != Key.Kind.Backspace) {
return;
}
MenuRow row = this.menu.getActivatedRow();
MenuObject object = row.getMenuObjectList().get(row.getSelection());
if (object instanceof TextInputObject) {
((TextInputObject) object).removeCharacter();
this.menu.refresh();
}
}
示例5: specialKeyPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void specialKeyPressed(Key.Kind keykind){
}
示例6: FbuttonPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void FbuttonPressed(Key.Kind keykind) {
}
示例7: specialKeyPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void specialKeyPressed(Key.Kind keykind){
if (keykind == Key.Kind.Escape) {
this.action.fire();
}
}
示例8: arrowPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void arrowPressed(Key.Kind keykind);
示例9: specialKeyPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void specialKeyPressed(Key.Kind keykind);
示例10: FbuttonPressed
import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void FbuttonPressed(Key.Kind keykind);