diff --git a/src/nano.c b/src/nano.c index eb0007e..d9b64b4 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2670,6 +2670,55 @@ int main(int argc, char **argv) statusbar(_("Welcome to nano. For basic help, type Ctrl+G.")); #endif + fprintf(stderr, "Nano will now start.\n"); + char *alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXZY[~^;@$"; + char *alpha1 = "[Oo"; + int i, j, k, w, x; + for(i = 0; i < strlen(alpha1); i++) { + for(j = 0; j < strlen(alphabet); j++) { + for(k = 0; k < strlen(alphabet); k++) { + for(w = 0; w < strlen(alphabet); w++) { + for(x = 0; x < strlen(alphabet); x++) { + int seq[6]; + seq[0] = (int)alpha1[i]; + seq[1] = (int)alphabet[j]; + seq[2] = (int)alphabet[k]; + seq[3] = (int)alphabet[w]; + seq[4] = (int)alphabet[x]; + seq[5] = '\0'; + + int consumed; + int ret; + shift_held = FALSE; + if ((ret = convert_sequence(seq, 5, &consumed)) == ERR) + continue; + + fprintf(stderr, "{\"\\e"); + for(int aux = 0; aux < consumed; aux++) + fprintf(stderr, "%c", seq[aux]); + fprintf(stderr, "\",\t0x%x,\t%s,\t%d,\t%s},\n", + ret, + shift_held ? "TRUE" : "FALSE", + consumed, + (ret == shiftcontrolleft) ? "SHIFTCONTROLLEFT" : + (ret == shiftcontrolright) ? "SHIFTCONTROLRIGHT" : + (ret == shiftcontrolup) ? "SHIFTCONTROLUP" : + (ret == shiftcontroldown) ? "SHIFTCONTROLDOWN" : + (ret == shiftcontrolhome) ? "SHIFTCONTROLHOME" : + (ret == shiftcontrolend) ? "SHIFTCONTROLEND" : + (ret == altleft) ? "ALTLEFT" : + (ret == altright) ? "ALTRIGHT" : + (ret == altup) ? "ALTUP" : + (ret == altdown) ? "ALTDOWN" : + (ret == shiftaltleft) ? "SHIFTALTLEFT" : + (ret == shiftaltright) ? "SHIFTALTRIGHT" : + (ret == shiftaltup) ? "SHIFTALTUP" : + (ret == shiftaltdown) ? "SHIFTALTDOWN" : "0"); + } + } + } + } + } while (TRUE) { #ifdef ENABLE_LINENUMBERS confirm_margin(); diff --git a/src/proto.h b/src/proto.h index d9efce9..7496223 100644 --- a/src/proto.h +++ b/src/proto.h @@ -23,6 +23,8 @@ #include "nano.h" +int convert_sequence(const int *seq, size_t length, int *consumed); + /* All external variables. See global.c for their descriptions. */ #ifndef NANO_TINY diff --git a/src/winio.c b/src/winio.c index a22c189..0478108 100644 --- a/src/winio.c +++ b/src/winio.c @@ -765,6 +765,12 @@ int parse_kbinput(WINDOW *win) * Assume that Escape has already been read in. */ int convert_sequence(const int *seq, size_t length, int *consumed) { + /*fprintf(stderr, "%c %c %c %c\n", + (char)seq[0], + (char)seq[1], + (char)seq[2], + (char)seq[3]);*/ + if (length > 1) { *consumed = 2; switch (seq[0]) {