X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=keymap.c;h=5e32da094ff3886e9b5c7ce5193a72bc2335aca4;hb=5fbd8a74d24624a118c9b835b136c73b8da076d7;hp=3a2f922c7eaf2f402c57002e1337fb7ead533653;hpb=c0845f1be75f82fb29cc3a15d26b819041e39813;p=apps%2Fmadmutt.git diff --git a/keymap.c b/keymap.c index 3a2f922..5e32da0 100644 --- a/keymap.c +++ b/keymap.c @@ -14,7 +14,7 @@ #include "mutt.h" #include "keymap.h" -#include +#include "crypt.h" #define MUTT_FUNCTIONS_VALUES #include "functions.def" @@ -36,10 +36,6 @@ struct mapping_t Menus[] = { {"key_select_smime", MENU_KEY_SELECT_SMIME}, #endif -#ifdef MIXMASTER - {"mix", MENU_MIX}, -#endif - {"query", MENU_QUERY}, {"generic", MENU_GENERIC}, {NULL, 0} @@ -60,7 +56,7 @@ static struct mapping_t KeyNames[] = { #ifdef KEY_ENTER {"", KEY_ENTER}, #endif - {"", M_ENTER_C}, + {"", '\n'}, {"", '\033'}, {"", '\t'}, {"", ' '}, @@ -116,7 +112,7 @@ static int parse_keycode (const char *s) static int parsekeys (const char *str, keycode_t * d, int max) { int n, len = max; - char buff[SHORT_STRING]; + char buff[STRING]; char c; char *s, *t; @@ -338,12 +334,12 @@ int km_dokey (int menu) for (;;) { /* ncurses doesn't return on resized screen when timeout is set to zero */ if (menu != MENU_EDITOR) - timeout ((Timeout > 0 ? Timeout : 60) * 1000); + wtimeout (stdscr, (Timeout > 0 ? Timeout : 60) * 1000); tmp = mutt_getch (); if (menu != MENU_EDITOR) - timeout (-1); /* restore blocking operation */ + wtimeout (stdscr, -1); /* restore blocking operation */ LastKey = tmp.ch; if (LastKey == -1) @@ -504,19 +500,8 @@ void km_init (void) create_bindings (OpAlias, MENU_ALIAS); create_bindings (OpPgp, MENU_PGP); create_bindings (OpSmime, MENU_SMIME); - -#ifdef CRYPT_BACKEND_GPGME create_bindings (OpPgp, MENU_KEY_SELECT_PGP); create_bindings (OpSmime, MENU_KEY_SELECT_SMIME); -#endif - -#ifdef MIXMASTER - create_bindings (OpMix, MENU_MIX); - - km_bindkey ("", MENU_MIX, OP_GENERIC_SELECT_ENTRY); - km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV); - km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT); -#endif /* bindings for the line editor */ create_bindings (OpEditor, MENU_EDITOR); @@ -601,7 +586,7 @@ void km_init (void) void km_error_key (int menu) { - char buf[SHORT_STRING]; + char buf[STRING]; struct keymap_t *key; if (!(key = km_find_func (menu, OP_HELP))) @@ -725,19 +710,10 @@ struct binding_t *km_get_table (int menu) return OpQuery; case MENU_PGP: return OpPgp; - -#ifdef CRYPT_BACKEND_GPGME case MENU_KEY_SELECT_PGP: return OpPgp; case MENU_KEY_SELECT_SMIME: return OpSmime; -#endif - -#ifdef MIXMASTER - case MENU_MIX: - return OpMix; -#endif - } return NULL; } @@ -748,12 +724,11 @@ int mutt_parse_bind (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ { struct binding_t *bindings = NULL; char *key; - int menu[sizeof (Menus) / sizeof (struct mapping_t) - 1], r = + int menu[countof(Menus) - 1], r = 0, nummenus, i; - if ((key = parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]), - &nummenus, err)) == NULL) - return (-1); + if (!(key = parse_keymap(menu, s, countof(menu), &nummenus, err))) + return -1; /* function to execute */ mutt_extract_token (buf, s, 0); @@ -882,9 +857,9 @@ void mutt_what_key (void) { int ch; - mvprintw (LINES - 1, 0, _("Enter keys (^G to abort): ")); + mvwprintw (stdscr, LINES - 1, 0, _("Enter keys (^G to abort): ")); do { - ch = getch (); + ch = wgetch (stdscr); if (ch != ERR && ch != ctrl ('G')) { mutt_message (_("Char = %s, Octal = %o, Decimal = %d"), km_keyname (ch), ch, ch);