本文整理匯總了Java中com.watabou.input.NoosaInputProcessor.Key方法的典型用法代碼示例。如果您正苦於以下問題:Java NoosaInputProcessor.Key方法的具體用法?Java NoosaInputProcessor.Key怎麽用?Java NoosaInputProcessor.Key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.watabou.input.NoosaInputProcessor
的用法示例。
在下文中一共展示了NoosaInputProcessor.Key方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onSignal
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
public void onSignal( NoosaInputProcessor.Key<GameAction> key ) {
if (key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
onBackPressed();
break;
case Input.Keys.MENU:
onMenuPressed();
break;
}
}
Game.instance.getInputProcessor().cancelKeyEvent();
}
示例2: onSignal
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
public void onSignal(NoosaInputProcessor.Key<GameAction> key) {
if (key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
case Input.Keys.ESCAPE:
onBackPressed();
break;
case Input.Keys.MENU:
onMenuPressed();
break;
default:
onKeyDown(key);
break;
}
} else {
onKeyUp(key);
}
Game.instance.getInputProcessor().cancelKeyEvent();
}
示例3: onSignal
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
public void onSignal( NoosaInputProcessor.Key<GameAction> key ) {
if (key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
case Input.Keys.ESCAPE:
onBackPressed();
break;
case Input.Keys.MENU:
onMenuPressed();
break;
default:
onKeyDown(key);
break;
}
} else {
onKeyUp( key );
}
Game.instance.getInputProcessor().cancelKeyEvent();
}
示例4: createChildren
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void createChildren() {
hotArea = new TouchArea<T>( 0, 0, 0, 0 ) {
@Override
protected void onTouchDown(NoosaInputProcessor.Touch touch) {
pressed = true;
pressTime = 0;
processed = false;
Button.this.onTouchDown();
};
@Override
protected void onTouchUp(NoosaInputProcessor.Touch touch) {
pressed = false;
Button.this.onTouchUp();
};
@Override
protected void onClick( NoosaInputProcessor.Touch touch ) {
if (!processed) {
if (NoosaInputProcessor.modifier && onLongClick()) {
// Do nothing
} else {
Button.this.onClick();
}
}
};
@Override
public boolean onKeyDown(NoosaInputProcessor.Key<T> key) {
return Button.this.onKeyDown(key);
}
@Override
public boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
return Button.this.onKeyUp(key);
}
};
add( hotArea );
}
示例5: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
protected boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
if (active && hotKey != null && key.action.equals(hotKey)) {
if (NoosaInputProcessor.modifier) {
return onLongClick();
} else {
onClick();
return true;
}
} else {
return false;
}
}
示例6: onSignal
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
public void onSignal(NoosaInputProcessor.Key<T> key) {
final boolean handled;
if (key.pressed) {
handled = onKeyDown(key);
} else {
handled = onKeyUp(key);
}
if (handled) {
Game.instance.getInputProcessor().cancelKeyEvent();
}
}
示例7: createChildren
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void createChildren() {
hotArea = new TouchArea<T>( 0, 0, 0, 0 ) {
@Override
protected void onTouchDown(NoosaInputProcessor.Touch touch) {
pressed = true;
pressTime = 0;
processed = false;
Button.this.onTouchDown();
};
@Override
protected void onTouchUp(NoosaInputProcessor.Touch touch) {
pressed = false;
Button.this.onTouchUp();
};
@Override
protected void onClick( NoosaInputProcessor.Touch touch ) {
if (!processed) {
if (NoosaInputProcessor.modifier && onLongClick()) {
// Do nothing
} else {
Button.this.onClick();
}
}
};
@Override
public boolean onKeyDown(NoosaInputProcessor.Key<T> key) {
return Button.this.onKeyDown(key);
}
@Override
public boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
return Button.this.onKeyUp(key);
}
};
add(hotArea);
}
示例8: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
protected boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
if (active && hotKey != null && key.action.equals(hotKey)) {
if (NoosaInputProcessor.modifier) {
return onLongClick();
} else {
onClick();
return true;
}
} else {
return false;
}
}
示例9: onSignal
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
public void onSignal(NoosaInputProcessor.Key<T> key) {
final boolean handled;
if (key.pressed) {
handled = onKeyDown(key);
} else {
handled = onKeyUp(key);
}
if (handled) {
Game.instance.getInputProcessor().cancelKeyEvent();
}
}
示例10: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
protected boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
if (active && hotKey != null && key.action.equals(hotKey)) {
if (NoosaInputProcessor.modifier) {
return onLongClick();
} else {
onClick();
return true;
}
} else {
return false;
}
}
示例11: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void onKeyUp( NoosaInputProcessor.Key<GameAction> key ) {
if (key.action == GameAction.BACKPACK) {
hide();
} else {
super.onKeyUp( key );
}
}
示例12: onKeyDown
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void onKeyDown(NoosaInputProcessor.Key key) {
if (key.code == Input.Keys.TAB) {
int next = 0;
for (int j = 0; j < tabs.size(); j++) {
Tab t = tabs.get(j);
if (t == selected) {
next = (j + 1) % tabs.size();
break;
}
}
select(next);
}
}
示例13: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void onKeyUp( NoosaInputProcessor.Key key ) {
if (key.action == GameAction.HERO_INFO) {
hide();
} else {
super.onKeyUp( key );
}
}
示例14: onKeyUp
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
@Override
protected void onKeyUp( NoosaInputProcessor.Key<GameAction> key ) {
if (key.action == GameAction.JOURNAL) {
hide();
} else {
super.onKeyUp( key );
}
}
示例15: onKeyDown
import com.watabou.input.NoosaInputProcessor; //導入方法依賴的package包/類
protected boolean onKeyDown(NoosaInputProcessor.Key<T> key) {
return false;
}