-
Notifications
You must be signed in to change notification settings - Fork 1
/
listview-keys.c
62 lines (50 loc) · 1.04 KB
/
listview-keys.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "listview-keys.h"
#include "explode.h"
#include <curses.h>
keypress_result conch_listview_keypress_dispatch(int key, listview *lv) {
switch (key) {
case '0':
case 'g':
conch_listview_jump_to_top(lv);
break;
case 'G':
conch_listview_jump_to_bottom(lv);
break;
case '.':
case '\t':
conch_listview_jump_to_next_unread(lv);
break;
case KEY_DOWN:
case 'j':
conch_listview_select_next_blast(lv);
break;
case KEY_UP:
case 'k':
conch_listview_select_prev_blast(lv);
break;
case KEY_NPAGE:
case ' ':
conch_listview_page_down(lv);
break;
case KEY_PPAGE:
conch_listview_page_up(lv);
break;
case 's':
conch_listview_toggle_stick_to_head(lv);
break;
case '/':
conch_listview_search_forward(lv);
break;
case 'n':
conch_listview_repeat_search_forward(lv);
break;
case 'i':
// i for insert into the database mode
conch_listview_create_blast(lv);
break;
case '\r':
case '\n':
return CONCH_DETAIL;
}
return CONCH_NOP;
}