当前位置: 首页>>代码示例>>Java>>正文


Java Key.Kind方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:23,代码来源:InputHandlerManager.java

示例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();
	}
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:9,代码来源:BasicDialogInputHandler.java

示例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();
	}
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:15,代码来源:BasicMenuInputHandler.java

示例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();
	}
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:12,代码来源:BasicMenuInputHandler.java

示例5: specialKeyPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void specialKeyPressed(Key.Kind keykind){
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:3,代码来源:GameInputHandler.java

示例6: FbuttonPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void FbuttonPressed(Key.Kind keykind) {
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:3,代码来源:GameInputHandler.java

示例7: specialKeyPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public void specialKeyPressed(Key.Kind keykind){
	if (keykind == Key.Kind.Escape) {
		this.action.fire();
	}
}
 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:6,代码来源:BasicDialogInputHandler.java

示例8: arrowPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void arrowPressed(Key.Kind keykind); 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:2,代码来源:InputHandler.java

示例9: specialKeyPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void specialKeyPressed(Key.Kind keykind); 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:2,代码来源:InputHandler.java

示例10: FbuttonPressed

import com.googlecode.lanterna.input.Key; //导入方法依赖的package包/类
public abstract void FbuttonPressed(Key.Kind keykind); 
开发者ID:Teascade,项目名称:Solid-Kingdom,代码行数:2,代码来源:InputHandler.java


注:本文中的com.googlecode.lanterna.input.Key.Kind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。