From: NeilBrown Date: Wed, 4 Oct 2023 06:12:10 +0000 (+1100) Subject: mode-basic: add F4 and F5 function key handlers. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=08a72d0844a5184dccc0212b47c2137319e61322;p=edlib.git mode-basic: add F4 and F5 function key handlers. Signed-off-by: NeilBrown --- diff --git a/DOC/TODO.md b/DOC/TODO.md index 9e9ddc01..e25e9a12 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -9,6 +9,8 @@ the file. ### Triage +- [ ] There is a "window:close" and a "Window:close" and they are + different. Fix this! - [X] unknown keysequence should be reported so e.g. if keyboard is is Greek mode, then I will be told that Cx-b doesn't work - [X] menubar doesn't redraw background when resized wider. @@ -51,7 +53,7 @@ the file. - [X] split range management out of autospell so it can be used by other modules. - [ ] make it easy for a make-search command to search backwards -- [ ] Make a start on CUA mode with mouse/menu/selection support. +- [X] Make a start on CUA mode with mouse/menu/selection support. Also Function keys: help, close, refresh ### Large diff --git a/display-ncurses.c b/display-ncurses.c index ee8ce70d..84f14022 100644 --- a/display-ncurses.c +++ b/display-ncurses.c @@ -1402,6 +1402,7 @@ DEF_CMD(force_redraw) ncurses_start(p); clearok(curscr, 1); + pane_damaged(p, DAMAGED_POSTORDER); return 1; } diff --git a/mode-basic.c b/mode-basic.c index 463537ff..acdf5cf0 100644 --- a/mode-basic.c +++ b/mode-basic.c @@ -568,6 +568,18 @@ DEF_CMD(basic_interactive_delete) return ret < 0 ? ret : 1; } +DEF_CMD(basic_close) +{ + call("Window:close", ci->focus); + return 1; +} + +DEF_CMD(basic_refresh) +{ + call("window:refresh", ci->focus); + return 1; +} + static struct map *basic_map; DEF_LOOKUP_CMD(mode_basic, basic_map); @@ -579,7 +591,10 @@ static void basic_init(void) m = key_alloc(); + /* Some Function keys that CUA defines */ key_add(m, "K:F1", &help_cmd.c); + key_add(m, "K:F4", &basic_close); + key_add(m, "K:F5", &basic_refresh); key_add_range(m, "K- ", "K-~", &basic_insert); key_add_range(m, "K-\200", "K-\377\377\377\377", &basic_insert);