Beispiel #1
0
        /// <summary>
        /// Processes key press.
        /// </summary>
        /// <param name="pressedKey">Pressed key.</param>
        /// <returns>True if the event was handled, false otherwise.</returns>
        public bool ProcessKeyPress(InputKey pressedKey)
        {
            if (entries.ProcessKeyPress(pressedKey))
            {
                return(true);
            }

            if (pressedKey == 'l' || pressedKey == Keys.Left || pressedKey == Keys.Enter)
            {
                var parentDir = entries.EntryInFocus.GetType() == typeof(SearchResultDirectoryEntry) ?
                                entries.EntryInFocus.Info.FullName :
                                ((FileInfo)entries.EntryInFocus.Info).DirectoryName;

                Search.Cancel();

                InvokeCommand?.Invoke(new ChangeDirectoryCommand(parentDir));
                return(true);
            }

            if (pressedKey == Keys.Escape)
            {
                Search.Cancel();
                pane.Status = JobStatus.Canceled;

                return(false);
            }

            return(false);
        }
 /// <summary>
 /// Processes key press.
 /// </summary>
 /// <param name="pressedKey">Pressed key.</param>
 /// <returns>True if the event was handled, false otherwise.</returns>
 public bool ProcessKeyPress(InputKey pressedKey)
 {
     return(entriesHolder.ProcessKeyPress(pressedKey));
 }