Package org.jboss.aesh.terminal

Examples of org.jboss.aesh.terminal.Key


            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }

                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(new CommandOperation(input));
                //the input is parsed by æsh
                else {
                    Operation operation = editMode.parseInput(inc, buffer.getLine());
                    if(inc != Key.UNKNOWN)
                        operation.setInput(inc.getKeyValues());
                    else
                        operation.setInput(new int[]{input[position]});
                    String result = parseOperation(operation, buffer.getPrompt().getMask());
                    if(result != null)
                        processOperationResult(result);
View Full Code Here


            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }

                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(new CommandOperation(input));
                //the input is parsed by æsh
                else {
                    Operation operation = editMode.parseInput(inc, buffer.getLine());
                    if(inc != Key.UNKNOWN)
                        operation.setInput(inc.getKeyValues());
                    else
                        operation.setInput(new int[]{input[position]});
                    String result = parseOperation(operation, buffer.getPrompt().getMask());
                    if(result != null)
                        processOperationResult(result);
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }
                //if we get ctrl-c/d while a process is running we'll try to kill
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }
                //if we get ctrl-c/d while a process is running we'll try to kill
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }
                //if we get ctrl-c/d while a process is running we'll try to kill
View Full Code Here

   {
      String output;
      try
      {
         StringBuilder sb = new StringBuilder();
         Key inputKey;
         do
         {
            CommandOperation input = commandInvocation.getInput();
            inputKey = input.getInputKey();
            if (inputKey == Key.CTRL_C || inputKey == Key.CTRL_D)
            {
               return null;
            }
            else if (inputKey == Key.BACKSPACE && sb.length() > 0)
            {
               sb.setLength(sb.length() - 1);
               if (echo)
               {
                  // move cursor left
                  out.print(Buffer.printAnsi("1D"));
                  out.flush();
                  // overwrite it with space
                  out.print(" ");
                  // move cursor back again
                  out.print(Buffer.printAnsi("1D"));
                  out.flush();
               }
            }
            else if (inputKey.isPrintable())
            {
               if (echo)
                  out.print(inputKey.getAsChar());

               sb.append(inputKey.getAsChar());
            }
         }
         while (inputKey != Key.ENTER && inputKey != Key.ENTER_2);
         output = (sb.length() == 0) ? null : sb.toString();
      }
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }
View Full Code Here

   {
      String output;
      try
      {
         StringBuilder sb = new StringBuilder();
         Key inputKey;
         do
         {
            CommandOperation input = commandInvocation.getInput();
            inputKey = input.getInputKey();
            if (inputKey == Key.CTRL_C || inputKey == Key.CTRL_D)
            {
               return null;
            }
            else if (inputKey == Key.BACKSPACE && sb.length() > 0)
            {
               sb.setLength(sb.length() - 1);
               if (echo)
               {
                  // move cursor left
                  out.print(Buffer.printAnsi("1D"));
                  out.flush();
                  // overwrite it with space
                  out.print(" ");
                  // move cursor back again
                  out.print(Buffer.printAnsi("1D"));
                  out.flush();
               }
            }
            else if (inputKey.isPrintable())
            {
               if (echo)
                  out.print(inputKey.getAsChar());

               sb.append(inputKey.getAsChar());
            }
         }
         while (inputKey != Key.ENTER && inputKey != Key.ENTER_2);
         output = (sb.length() == 0) ? null : sb.toString();
      }
View Full Code Here

            boolean parsing = true;
            //use a position instead of changing the array
            int position = 0;
            //if we get a paste or have input lag this should parse it correctly...
            while(parsing) {
                Key inc = Key.findStartKey(input, position);
                if(input.length > inc.getKeyValues().length+position) {
                    position += inc.getKeyValues().length;
                }
                else {
                    parsing = false;
                }

                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(new CommandOperation(input));
                //the input is parsed by æsh
                else {
                    Operation operation = editMode.parseInput(inc, buffer.getLine());
                    if(inc != Key.UNKNOWN)
                        operation.setInput(inc.getKeyValues());
                    else
                        operation.setInput(new int[]{input[position]});
                    String result = parseOperation(operation, buffer.getPrompt().getMask());
                    if(result != null)
                        processOperationResult(result);
View Full Code Here

TOP

Related Classes of org.jboss.aesh.terminal.Key

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.