diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-20 20:10:45 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-20 20:10:45 +0000 |
commit | 5a2beb745f87a113bbb1db775d0450f65ceb2124 (patch) | |
tree | 328250c622664b81d4eab19b9ee0f0cc817cda71 /ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c | |
parent | f7c8bd9f9d22d3124ef30737dae2fbe49fdacd41 (diff) | |
download | edk2-platforms-5a2beb745f87a113bbb1db775d0450f65ceb2124.tar.xz |
ShellPkg: Added the Ctrl based hot key and changed text editor's UI.
* Add Ctrl-E hotkey for help
* Add Ctrl based hotkey alternatives to function hotkeys
* Don't show hotkey help on the main screen
* Change the file buffer's row count for display to adjust the new screen format
* Change the edit status bar location, the new edit status bar is in the last line
* Change the location of the edit bar, the new edit input bar is in the last line
Signed-off-by: kidzyoung
reviewed-by: jcarsey
reviewed-by: jljusten
reviewed-by: jiang
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12036 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c index 390c707bc6..b721850300 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c @@ -16,7 +16,8 @@ #include "UefiShellDebug1CommandsLib.h"
#include "EditStatusBar.h"
-EDITOR_MENU_ITEM *MenuItems;
+EDITOR_MENU_ITEM *MenuItems;
+MENU_ITEM_FUNCTION *ControlBasedMenuFunctions;
UINTN NumItems;
/**
@@ -32,7 +33,7 @@ MenuBarCleanup ( }
/**
- Initializa the menu bar with the specified items.
+ Initialize the menu bar with the specified items.
@param[in] Items The items to display and their functions.
@@ -58,6 +59,22 @@ MenuBarInit ( }
/**
+ Initialize the control hot-key with the specified items.
+
+ @param[in] Items The hot-key functions.
+
+ @retval EFI_SUCCESS The initialization was correct.
+**/
+EFI_STATUS
+EFIAPI
+ControlHotKeyInit (
+ IN MENU_ITEM_FUNCTION *Items
+ )
+{
+ ControlBasedMenuFunctions = Items;
+ return EFI_SUCCESS;
+}
+/**
Refresh function for the menu bar.
@param[in] LastRow The last printable row.
@@ -150,3 +167,30 @@ MenuBarDispatchFunctionKey ( return (MenuItems[Index].Function ());
}
+/**
+ Function to dispatch the correct function based on a control-based key (ctrl+o...)
+
+ @param[in] Key The pressed key.
+
+ @retval EFI_NOT_FOUND The key was not a valid control-based key
+ (an error was sent to the status bar).
+ @return EFI_SUCCESS.
+**/
+EFI_STATUS
+EFIAPI
+MenuBarDispatchControlHotKey (
+ IN CONST EFI_INPUT_KEY *Key
+ )
+{
+
+ if ((SCAN_CONTROL_Z < Key->UnicodeChar)
+ ||(NULL == ControlBasedMenuFunctions[Key->UnicodeChar]))
+ {
+ return EFI_NOT_FOUND;
+ }
+
+ ControlBasedMenuFunctions[Key->UnicodeChar]();
+ return EFI_SUCCESS;
+}
+
+
|