use Ctrl+v to paste from clipboard

This commit is contained in:
gutmet 2021-03-15 13:38:21 +01:00
parent 1a13d0465d
commit e9c79a7dc7
3 changed files with 4 additions and 8 deletions

View File

@ -10,6 +10,7 @@ MIT/X Consortium License
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
© 2014-2020 Hiltjo Posthuma <hiltjo@codemadness.org>
© 2015-2019 Quentin Rameau <quinq@fifth.space>
© 2021 Alexander Weinhold <me dot dmenu at gutmet dot org>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -160,10 +160,7 @@ Delete line left
.B C\-w
Delete word left
.TP
.B C\-y
Paste from primary X selection
.TP
.B C\-Y
.B C\-v
Paste from X clipboard
.TP
.B M\-b

View File

@ -354,10 +354,8 @@ keypress(XKeyEvent *ev)
while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
insert(NULL, nextrune(-1) - cursor);
break;
case XK_y: /* paste selection */
case XK_Y:
XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
utf8, utf8, win, CurrentTime);
case XK_v:
XConvertSelection(dpy, clip, utf8, utf8, win, CurrentTime);
return;
case XK_Left:
movewordedge(-1);