Search
SailfishOS Open Build Service
>
Projects
>
home:minlexx
:
mer:tools
>
htop
> _service:tar_git:show-alternative-keys-in-functionbar.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:show-alternative-keys-in-functionbar.patch of Package htop
diff --git a/FunctionBar.c b/FunctionBar.c index 659f410..113b499 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -28,6 +28,12 @@ typedef struct FunctionBar_ { }*/ +static bool AltKeys = false; +static const char* Alt_FunctionBar_FKeys[] = {" h", " S", " /", " \\", " t", " >", " ]", " [", " k", " q", NULL}; +void FunctionBar_useAltKeys(bool use_alt_keys) { + AltKeys = use_alt_keys; +} + static const char* FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL}; static const char* FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL}; @@ -64,7 +70,7 @@ FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* eve this->size = i; } else { this->staticData = true; - this->keys = (char**) FunctionBar_FKeys; + this->keys = AltKeys ? (char**) Alt_FunctionBar_FKeys : (char**) FunctionBar_FKeys; this->events = FunctionBar_FEvents; this->size = 10; } diff --git a/FunctionBar.h b/FunctionBar.h index 1975fa3..bf2cac4 100644 --- a/FunctionBar.h +++ b/FunctionBar.h @@ -21,6 +21,7 @@ typedef struct FunctionBar_ { } FunctionBar; +void FunctionBar_useAltKeys(bool use_alt_keys); FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); diff --git a/htop.c b/htop.c index 239b5d6..be7b1f4 100644 --- a/htop.c +++ b/htop.c @@ -84,6 +84,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) { {"no-colour",no_argument, 0, 'C'}, {"pid", required_argument, 0, 'p'}, {"io", no_argument, 0, 'i'}, + {"alt-keys", no_argument, 0, 'a'}, {0,0,0,0} }; @@ -92,6 +93,9 @@ static CommandLineSettings parseArguments(int argc, char** argv) { while ((opt = getopt_long(argc, argv, "hvCs:d:u:p:i", long_opts, &opti))) { if (opt == EOF) break; switch (opt) { + case 'a': + FunctionBar_useAltKeys(true); + break; case 'h': printHelpFlag(); break;