diff --git a/console.php b/console.php index da22604..0f3719a 100644 --- a/console.php +++ b/console.php @@ -116,7 +116,7 @@ class console $char = $this->getKey (); return $char; } - // }}} + // }}} /** Wait one key pressed by the user. If the key pressed is an ESC sequence, * return this sequence @@ -290,6 +290,15 @@ class console $this->moveCursor ($cursorPos); } // }}} + elseif (ord ($char) === 4) + // {{{ + { + // Logout (Ctrl+D) + $string = "exit"; + $this->rewriteLine ($prompt.$string); + return $string; + } + // }}} elseif (ord($char) === 21) // Empty line from prompt to cursor (Ctrl+U) // {{{ @@ -451,6 +460,12 @@ class console } // }}} } + elseif (in_array (ord ($char), $this->nonWriteableChar)) + // Non writeable char : skip it + // {{{ + { + } + // }}} else // Normal char : Add it to the string // {{{