本文整理汇总了Java中de.lessvoid.nifty.input.NiftyInputEvent类的典型用法代码示例。如果您正苦于以下问题:Java NiftyInputEvent类的具体用法?Java NiftyInputEvent怎么用?Java NiftyInputEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NiftyInputEvent类属于de.lessvoid.nifty.input包,在下文中一共展示了NiftyInputEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public NiftyInputEvent convert(KeyboardInputEvent inputEvent)
{
if (inputEvent.isKeyDown())
{
if (inputEvent.getKey() == KeyboardInputEvent.KEY_NEXT && inputEvent.isShiftDown())
{
return NiftyInputEvent.NextInputElement;
}
else if (inputEvent.getKey() == KeyboardInputEvent.KEY_PRIOR && inputEvent.isShiftDown())
{
return NiftyInputEvent.PrevInputElement;
}
else if (inputEvent.getKey() == KeyboardInputEvent.KEY_TAB)
{
// disable the default nifty behaviour for tab
// otherwise we have to provide an inputMapping for every focusable element.
NiftyInputEvent.Character.setCharacter((char) 0);
return NiftyInputEvent.Character;
}
}
return null;
}
示例2: convert
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public NiftyInputEvent convert(KeyboardInputEvent inputEvent)
{
if (!inputEvent.isKeyDown())
{
switch (inputEvent.getKey())
{
case KeyboardInputEvent.KEY_ESCAPE:
return NiftyInputEvent.Escape;
}
}
if (!Character.isISOControl(inputEvent.getCharacter()))
{
// this is pretty silly...
NiftyInputEvent.Character.setCharacter(inputEvent.getCharacter());
return NiftyInputEvent.Character;
}
return null;
}
示例3: keyEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public boolean keyEvent(final NiftyInputEvent inputEvent)
{
if (inputEvent == null)
{
return false;
}
log.log(Level.FINE, "event received: {0}", inputEvent);
if (inputEvent == NiftyInputEvent.SubmitText)
{
sendText();
return true;
}
else if (inputEvent == NiftyInputEvent.MoveCursorRight)
{
}
return false;
}
示例4: keyEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public boolean keyEvent(NiftyInputEvent inputEvent) {
if (inputEvent == NiftyStandardInputEvent.Escape) {
nifty.setAlternateKey("exit");
nifty.gotoScreen("loading");
return true;
}
return false;
}
示例5: keyEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public boolean keyEvent(NiftyInputEvent inputEvent) {
if (inputEvent == NiftyStandardInputEvent.Escape) {
nifty.setAlternateKey("exit");
nifty.gotoScreen("nifty-splash");
return true;
}
return false;
}
示例6: keyEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public boolean keyEvent(NiftyInputEvent inputEvent) {
if (inputEvent == NiftyStandardInputEvent.Escape) {
if (popupExit) {
closePopupExit("no");
} else {
openPopupExit();
}
return true;
}
return false;
}
示例7: inputEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public boolean inputEvent(@Nonnull NiftyInputEvent niftyInputEvent) {
return false;
}
示例8: keyEvent
import de.lessvoid.nifty.input.NiftyInputEvent; //导入依赖的package包/类
@Override
public boolean keyEvent(NiftyInputEvent nie) {
return false;
}