Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stdin: Add support for standard F-key mapping from stdin

  • Loading branch information...
commit 109a3ac3ff9ba09c987298dd08c78341b3576178 1 parent eb9a215
@andoma andoma authored
Showing with 23 additions and 23 deletions.
  1. +23 −23 src/ipc/stdin.c
View
46 src/ipc/stdin.c
@@ -33,28 +33,28 @@
const static struct {
const uint8_t *codes;
int action;
- const char *desc;
+ int fkey;
} map[] = {
- {ESEQ(0x1b,0x5b,0x41,0x00), ACTION_UP, NULL },
- {ESEQ(0x1b,0x5b,0x42,0x00), ACTION_DOWN, NULL },
- {ESEQ(0x1b,0x5b,0x43,0x00), ACTION_RIGHT, NULL },
- {ESEQ(0x1b,0x5b,0x44,0x00), ACTION_LEFT, NULL },
- {ESEQ(0x1b,0x4f,0x50,0x00), 0, "F1" },
- {ESEQ(0x1b,0x4f,0x51,0x00), 0, "F2" },
- {ESEQ(0x1b,0x4f,0x52,0x00), 0, "F3" },
- {ESEQ(0x1b,0x4f,0x53,0x00), 0, "F4" },
- {ESEQ(0x1b,0x5b,0x31,0x35,0x7e,0x00), 0, "F5" },
- {ESEQ(0x1b,0x5b,0x31,0x37,0x7e,0x00), 0, "F6" },
- {ESEQ(0x1b,0x5b,0x31,0x38,0x7e,0x00), 0, "F7" },
- {ESEQ(0x1b,0x5b,0x31,0x39,0x7e,0x00), 0, "F8" },
- {ESEQ(0x1b,0x5b,0x32,0x30,0x7e,0x00), 0, "F9" },
- {ESEQ(0x1b,0x5b,0x32,0x31,0x7e,0x00), 0, "F10" },
- {ESEQ(0x1b,0x5b,0x32,0x32,0x7e,0x00), 0, "F11" },
- {ESEQ(0x1b,0x5b,0x32,0x33,0x7e,0x00), 0, "F12" },
- {ESEQ(0x1b,0x5b,0x35,0x7e,0x00), 0, "Prior"},
- {ESEQ(0x1b,0x5b,0x36,0x7e,0x00), 0, "Next"},
- {ESEQ(0x1b,0x4f,0x48,0x00), 0, "Home"},
- {ESEQ(0x1b,0x4f,0x46,0x00), 0, "End"},
+ {ESEQ(0x1b,0x5b,0x41,0x00), ACTION_UP, 0 },
+ {ESEQ(0x1b,0x5b,0x42,0x00), ACTION_DOWN, 0 },
+ {ESEQ(0x1b,0x5b,0x43,0x00), ACTION_RIGHT, 0 },
+ {ESEQ(0x1b,0x5b,0x44,0x00), ACTION_LEFT, 0 },
+ {ESEQ(0x1b,0x4f,0x50,0x00), 0, 0x1 },
+ {ESEQ(0x1b,0x4f,0x51,0x00), 0, 0x2 },
+ {ESEQ(0x1b,0x4f,0x52,0x00), 0, 0x3 },
+ {ESEQ(0x1b,0x4f,0x53,0x00), 0, 0x4 },
+ {ESEQ(0x1b,0x5b,0x31,0x35,0x7e,0x00), 0, 0x5 },
+ {ESEQ(0x1b,0x5b,0x31,0x37,0x7e,0x00), 0, 0x6 },
+ {ESEQ(0x1b,0x5b,0x31,0x38,0x7e,0x00), 0, 0x7 },
+ {ESEQ(0x1b,0x5b,0x31,0x39,0x7e,0x00), 0, 0x8 },
+ {ESEQ(0x1b,0x5b,0x32,0x30,0x7e,0x00), 0, 0x9 },
+ {ESEQ(0x1b,0x5b,0x32,0x31,0x7e,0x00), 0, 0xa },
+ {ESEQ(0x1b,0x5b,0x32,0x32,0x7e,0x00), 0, 0xb },
+ {ESEQ(0x1b,0x5b,0x32,0x33,0x7e,0x00), 0, 0xc },
+ {ESEQ(0x1b,0x5b,0x35,0x7e,0x00), ACTION_PAGE_UP},
+ {ESEQ(0x1b,0x5b,0x36,0x7e,0x00), ACTION_PAGE_DOWN},
+ {ESEQ(0x1b,0x4f,0x48,0x00), ACTION_TOP},
+ {ESEQ(0x1b,0x4f,0x46,0x00), ACTION_BOTTOM},
};
@@ -135,8 +135,8 @@ stdin_thread(void *aux)
if(map[i].action) {
e = event_create_action(map[i].action);
- } else if(map[i].desc != NULL) {
- e = event_create_str(EVENT_KEYDESC, map[i].desc);
+ } else if(map[i].fkey) {
+ e = event_from_Fkey(map[i].fkey, 0);
}
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.