Package de.lessvoid.nifty.input

Examples of de.lessvoid.nifty.input.NiftyInputEvent


   * @param nifty nifty
   * @param inputEvent keyboard event
   * @return return true when the input event has been processed and false when it has not been handled
   */
  public boolean keyEvent(final Nifty nifty, final KeyboardInputEvent inputEvent, final String elementId) {
    NiftyInputEvent converted = inputMapper.convert(inputEvent);

    for (KeyInputHandler handler : preInputHandler) {
      if (handler.keyEvent(converted)) {
        return true;
      }
View Full Code Here


        return NiftyInputEvent.PrevInputElement;
      } else {
        return NiftyInputEvent.NextInputElement;
      }
    } else if (!Character.isISOControl(inputEvent.getCharacter())) {
      NiftyInputEvent character = NiftyInputEvent.Character;
      character.setCharacter(inputEvent.getCharacter());
      return character;
    }

    if (inputEvent.isControlDown()) {
      if (inputEvent.getKey() == KeyboardInputEvent.KEY_X) {
View Full Code Here

public class TextFieldInputMappingAdv extends TextFieldInputMapping {

  @Override
  public NiftyInputEvent convert(KeyboardInputEvent inputEvent) {
   
    NiftyInputEvent evt = super.convert(inputEvent);
   
    if(evt != null)
      return evt;
   
    if(!inputEvent.isKeyDown() || inputEvent.getKey() == KeyboardInputEvent.KEY_LCONTROL || inputEvent.getKey() == KeyboardInputEvent.KEY_RCONTROL)
      return null;
   
    evt = NiftyInputEvent.Character;
    evt.setCharacter('?');
   
    if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_Q)
      evt.setCharacter('@');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_2)
      evt.setCharacter('�');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_3)
      evt.setCharacter('�');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_7)
      evt.setCharacter('{');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_8)
      evt.setCharacter('[');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_9)
      evt.setCharacter(']');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_0)
      evt.setCharacter('}');
    else if(inputEvent.isControlDown() && inputEvent.getCharacter() == '�')
      evt.setCharacter('\\');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_EQUALS)
      evt.setCharacter('~');
//    else if(inputEvent.isControlDown() && inputEvent.getCharacter() == '+')
//      evt.setCharacter('~');
    else if(inputEvent.isControlDown() && inputEvent.getKey() == KeyboardInputEvent.KEY_M)
      evt.setCharacter('�');
    else if(inputEvent.isControlDown() && inputEvent.getCharacter() == '<')
      evt.setCharacter('|');
    else
      return null;
   
    return evt;
  }
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.input.NiftyInputEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.