From 556d58a073760d3685723c9b8d8ea278eaacddd6 Mon Sep 17 00:00:00 2001 From: Joachim Henke <37883863+jo-he@users.noreply.github.com> Date: Sun, 7 Jul 2019 18:38:46 +0200 Subject: [PATCH] allow for mapping the Insert key --- doc/pages/mapping.asciidoc | 3 +++ src/keys.cc | 1 + src/keys.hh | 1 + src/ncurses_ui.cc | 2 ++ 4 files changed, 7 insertions(+) diff --git a/doc/pages/mapping.asciidoc b/doc/pages/mapping.asciidoc index 8e6699f7..295224c2 100644 --- a/doc/pages/mapping.asciidoc +++ b/doc/pages/mapping.asciidoc @@ -132,6 +132,9 @@ be used: **, **, **, **:: The usual cursor-movement keys. +**:: + The Insert key. + **, **, ...**:: Function keys. diff --git a/src/keys.cc b/src/keys.cc index edbd5e0c..927baed9 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -74,6 +74,7 @@ static constexpr KeyAndName keynamemap[] = { { "pagedown", Key::PageDown }, { "home", Key::Home }, { "end", Key::End }, + { "ins", Key::Insert }, { "del", Key::Delete }, { "plus", '+' }, { "minus", '-' }, diff --git a/src/keys.hh b/src/keys.hh index b0940bd6..74d1b545 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -50,6 +50,7 @@ struct Key PageDown, Home, End, + Insert, Tab, F1, F2, diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 32cfea57..5b6c4bad 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -606,6 +606,8 @@ Optional NCursesUI::get_next_key() case KEY_SHOME: return shift(Key::Home); case KEY_END: return {Key::End}; case KEY_SEND: return shift(Key::End); + case KEY_IC: return {Key::Insert}; + case KEY_SIC: return shift(Key::Insert); case KEY_BTAB: return shift(Key::Tab); case KEY_RESIZE: return resize(dimensions()); }