summaryrefslogtreecommitdiffstats
path: root/src/keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keys.c')
-rw-r--r--src/keys.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/keys.c b/src/keys.c
index 56562ed..a908bd0 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -56,14 +56,14 @@ static struct keydef_s keydef[NBKEYS] = {
{"generic-help", "?"},
{"generic-quit", "q Q"},
{"generic-save", "s S C-s"},
- {"generic-cut", "C-x"},
- {"generic-paste", "C-v"},
+ {"generic-copy", "c"},
+ {"generic-paste", "p C-v"},
{"generic-change-view", "TAB"},
{"generic-import", "i I"},
{"generic-export", "x X"},
{"generic-goto", "g G"},
{"generic-other-cmd", "o O"},
- {"generic-config-menu", "c C"},
+ {"generic-config-menu", "C"},
{"generic-redraw", "C-r"},
{"generic-add-appt", "C-a"},
{"generic-add-todo", "C-t"},
@@ -179,12 +179,13 @@ enum key keys_get_action(int pressed)
return actions[pressed];
}
-enum key keys_getch(WINDOW * win, int *count)
+enum key keys_getch(WINDOW * win, int *count, int *reg)
{
int ch = '0';
- if (count) {
+ if (count && reg) {
*count = 0;
+ *reg = 0;
do {
*count = *count * 10 + ch - '0';
ch = wgetch(win);
@@ -193,8 +194,23 @@ enum key keys_getch(WINDOW * win, int *count)
if (*count == 0)
*count = 1;
- } else
+
+ if (ch == '"') {
+ ch = wgetch(win);
+ if (ch >= '1' && ch <= '9') {
+ *reg = ch - '1' + 1;
+ }
+ else if (ch >= 'a' && ch <= 'z') {
+ *reg = ch - 'a' + 10;
+ }
+ else if (ch == '_') {
+ *reg = REG_BLACK_HOLE;
+ }
+ ch = wgetch(win);
+ }
+ } else {
ch = wgetch(win);
+ }
switch (ch) {
case KEY_RESIZE:
@@ -444,7 +460,7 @@ void keys_popup_info(enum key key)
_("Display hints whenever some help screens are available.");
info[KEY_GENERIC_QUIT] = _("Exit from the current menu, or quit calcurse.");
info[KEY_GENERIC_SAVE] = _("Save calcurse data.");
- info[KEY_GENERIC_CUT] = _("Cut the item that is currently selected.");
+ info[KEY_GENERIC_COPY] = _("Copy the item that is currently selected.");
info[KEY_GENERIC_PASTE] = _("Paste an item at the current position.");
info[KEY_GENERIC_CHANGE_VIEW] =
_("Select next panel in calcurse main screen.");
@@ -522,7 +538,7 @@ void keys_popup_info(enum key key)
#define WINCOL (col - 4)
infowin = popup(WINROW, WINCOL, (row - WINROW) / 2, (col - WINCOL) / 2,
keydef[key].label, info[key], 1);
- keys_getch(infowin, NULL);
+ keys_getch(infowin, NULL, NULL);
delwin(infowin);
#undef WINROW
#undef WINCOL