示例#1
0
 @Override
 public boolean onKeyboardEvent(KeyboardEvent event) {
   if (event == null) throw new NullPointerException("event may not be null");
   if (closing.onKeyboardEvent(event)) return true;
   if (event.isModified() || !event.isSpecial()) return false;
   switch (event.getSpecial()) {
     case ENTER:
       return closing.doOk();
     case ARROW_DOWN:
       return onArrowDown(event, false);
     case ARROW_UP:
       return onArrowUp(event, false);
     case ALTERNATIVE_ARROW_DOWN:
       return onArrowDown(event, true);
     case ALTERNATIVE_ARROW_UP:
       return onArrowUp(event, true);
     case ARROW_LEFT:
       return onArrowLeft(event);
     case ARROW_RIGHT:
       return onArrowRight(event);
     case ALTERNATIVE_ARROW_LEFT:
       return onAltLeft(event);
     case ALTERNATIVE_ARROW_RIGHT:
       return onAltRight(event);
     case PAGE_DOWN:
       return onPageDown(event, false);
     case PAGE_UP:
       return onPageUp(event, false);
     case ALTERNATIVE_PAGE_DOWN:
       return onPageDown(event, true);
     case ALTERNATIVE_PAGE_UP:
       return onPageUp(event, true);
     case HOME:
       return onHome(event);
     case END:
       return onEnd(event);
     case ALTERNATIVE_HOME:
       return onAltHome(event);
     case ALTERNATIVE_END:
       return onAltEnd(event);
     case INSERT:
       return onInsert(event);
     default:
       return false;
   }
 }
示例#2
0
 @Override
 public boolean onEnvironmentEvent(EnvironmentEvent event) {
   NullCheck.notNull(event, "event");
   if (closing.onEnvironmentEvent(event)) return true;
   if (region.onEnvironmentEvent(event, hotPointX, hotPointY)) return false;
   switch (event.getCode()) {
     case REFRESH:
       refresh();
       return true;
     case INTRODUCE:
       luwrain.silence();
       luwrain.playSound(Sounds.INTRO_POPUP);
       luwrain.say(getAreaName());
       return true;
     default:
       return false;
   }
 }