patch-view.c - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
(HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
(DIR) Log
(DIR) Files
(DIR) Refs
---
patch-view.c
---
1 $NetBSD$
2
3 Adjust keybindings.
4
5 --- view.c.orig 2018-11-25 17:39:39.000000000 +0000
6 +++ view.c
7 @@ -3250,7 +3250,7 @@ static int frame_ev(struct session *ses,
8 return 1;
9 }
10 if (ev->x == KBD_PAGE_DOWN || (ev->x == ' ' && (!(ev->y & KBD_ALT))) || (upcase(ev->x) == 'F' && ev->y & KBD_CTRL)) rep_ev(ses, fd, page_down, 0);
11 - else if (ev->x == KBD_PAGE_UP || (upcase(ev->x) == 'B' && (!(ev->y & KBD_ALT)))) rep_ev(ses, fd, page_up, 0);
12 + else if (ev->x == KBD_PAGE_UP) rep_ev(ses, fd, page_up, 0);
13 else if (ev->x == KBD_DOWN) rep_ev(ses, fd, down, 0);
14 else if (ev->x == KBD_UP) rep_ev(ses, fd, up, 0);
15 else if (ev->x == KBD_LEFT && ses->term->spec->braille) rep_ev(ses, fd, left, 0);
16 @@ -3642,15 +3642,11 @@ void send_event(struct session *ses, str
17 next_frame(ses, ev->y ? -1 : 1);
18 draw_formatted(ses);
19 }
20 - if (ev->x == KBD_LEFT && !ses->term->spec->braille) {
21 + if ((ev->x == 'b' && !(ev->y & (KBD_CTRL | KBD_ALT))) || ev->x == KBD_BS || ev->x == KBD_BACK) {
22 go_back(ses, 1);
23 goto x;
24 }
25 - if ((upcase(ev->x) == 'Z' && !(ev->y & (KBD_CTRL | KBD_ALT))) || ev->x == KBD_BS || ev->x == KBD_BACK) {
26 - go_back(ses, 1);
27 - goto x;
28 - }
29 - if ((upcase(ev->x) == 'X' && !(ev->y & (KBD_CTRL | KBD_ALT))) || ev->x == '\'' || ev->x == KBD_FORWARD) {
30 + if ((ev->x == 'B' && !(ev->y & (KBD_CTRL | KBD_ALT))) || ev->x == '\'' || ev->x == KBD_FORWARD) {
31 go_back(ses, -1);
32 goto x;
33 }
34 @@ -3664,16 +3660,16 @@ void send_event(struct session *ses, str
35 print_screen_status(ses);
36 goto x;
37 }
38 - if ((upcase(ev->x) == 'R' && ev->y & KBD_CTRL) || ev->x == KBD_RELOAD) {
39 + if (ev->x == 'r' || ev->x == KBD_RELOAD) {
40 reload(ses, -1);
41 goto x;
42 }
43 - if ((ev->x == 'g' && !(ev->y & (KBD_CTRL | KBD_ALT))) || (ev->x == KBD_OPEN && !(ev->y & (KBD_SHIFT | KBD_CTRL)))) {
44 + if ((ev->x == 'o' && !(ev->y & (KBD_CTRL | KBD_ALT))) || (ev->x == KBD_OPEN && !(ev->y & (KBD_SHIFT | KBD_CTRL)))) {
45 quak:
46 dialog_goto_url(ses, cast_uchar "");
47 goto x;
48 }
49 - if ((ev->x == 'G' && !(ev->y & (KBD_CTRL | KBD_ALT))) || (ev->x == KBD_OPEN && ev->y & KBD_SHIFT)) {
50 + if ((ev->x == 'O' && !(ev->y & (KBD_CTRL | KBD_ALT))) || (ev->x == KBD_OPEN && ev->y & KBD_SHIFT)) {
51 unsigned char *s;
52 if (list_empty(ses->history) || !ses->screen->rq->url) goto quak;
53 s = display_url(ses->term, ses->screen->rq->url, 0);
54 @@ -3690,6 +3686,19 @@ void send_event(struct session *ses, str
55 mem_free(s);
56 goto x;
57 }
58 + if (ev->x == 'p') {
59 + unsigned char *clip = get_clipboard_text(ses->term);
60 + if (clip) {
61 + goto_url(ses, clip);
62 + mem_free(clip);
63 + }
64 + goto x;
65 + }
66 + if (ev->x == 'y') {
67 + if (ses->screen->rq->url)
68 + set_clipboard_text(ses->term, ses->screen->rq->url);
69 + goto x;
70 + }
71 if (ev->x == KBD_PROPS) {
72 dialog_html_options(ses);
73 goto x;