diff options
| author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-11-13 20:04:39 +0100 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-11-13 20:04:39 +0100 |
| commit | 93f31166bfff317e050dde1723cfa8302c6f85d3 (patch) | |
| tree | 48116bbaedf5e4484ab668bf34a6e01b9c0f104f | |
| parent | 69ee3ba3a771ca60bc8738174c79fc851818a36b (diff) | |
| download | st-93f31166bfff317e050dde1723cfa8302c6f85d3.tar.gz st-93f31166bfff317e050dde1723cfa8302c6f85d3.zip | |
Move Shift + Insert to shortcut
Shift + Insert is used like a hot key for paste the selection, so it is more
logical move it to shortcut array instead of having special code for it.
---
config.def.h | 1 +
st.c | 13 +++----------
2 files changed, 4 insertions(+), 10 deletions(-)
| -rw-r--r-- | config.def.h | 1 | ||||
| -rw-r--r-- | st.c | 13 |
2 files changed, 4 insertions, 10 deletions
diff --git a/config.def.h b/config.def.h index ee677a5..3bf35d9 100644 --- a/config.def.h +++ b/config.def.h | |||
| @@ -93,5 +93,6 @@ static Shortcut shortcuts[] = { | |||
| 93 | /* modifier key function argument */ | 93 | /* modifier key function argument */ |
| 94 | { MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} }, | 94 | { MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} }, |
| 95 | { MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} }, | 95 | { MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} }, |
| 96 | { ShiftMask, XK_Insert, selpaste, {.i = 0} }, | ||
| 96 | }; | 97 | }; |
| 97 | 98 | ||
| @@ -261,6 +261,7 @@ typedef struct { | |||
| 261 | 261 | ||
| 262 | /* function definitions used in config.h */ | 262 | /* function definitions used in config.h */ |
| 263 | static void xzoom(const Arg *); | 263 | static void xzoom(const Arg *); |
| 264 | static void selpaste(const Arg *); | ||
| 264 | 265 | ||
| 265 | /* Config.h for applying patches and the configuration. */ | 266 | /* Config.h for applying patches and the configuration. */ |
| 266 | #include "config.h" | 267 | #include "config.h" |
| @@ -360,7 +361,6 @@ static void selrequest(XEvent *); | |||
| 360 | static void selinit(void); | 361 | static void selinit(void); |
| 361 | static inline bool selected(int, int); | 362 | static inline bool selected(int, int); |
| 362 | static void selcopy(void); | 363 | static void selcopy(void); |
| 363 | static void selpaste(void); | ||
| 364 | static void selscroll(int, int); | 364 | static void selscroll(int, int); |
| 365 | 365 | ||
| 366 | static int utf8decode(char *, long *); | 366 | static int utf8decode(char *, long *); |
| @@ -750,7 +750,7 @@ selnotify(XEvent *e) { | |||
| 750 | } | 750 | } |
| 751 | 751 | ||
| 752 | void | 752 | void |
| 753 | selpaste(void) { | 753 | selpaste(const Arg *dummy) { |
| 754 | XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY, | 754 | XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY, |
| 755 | xw.win, CurrentTime); | 755 | xw.win, CurrentTime); |
| 756 | } | 756 | } |
| @@ -821,7 +821,7 @@ brelease(XEvent *e) { | |||
| 821 | } | 821 | } |
| 822 | 822 | ||
| 823 | if(e->xbutton.button == Button2) { | 823 | if(e->xbutton.button == Button2) { |
| 824 | selpaste(); | 824 | selpaste(NULL); |
| 825 | } else if(e->xbutton.button == Button1) { | 825 | } else if(e->xbutton.button == Button1) { |
| 826 | sel.mode = 0; | 826 | sel.mode = 0; |
| 827 | getbuttoninfo(e, NULL, &sel.ex, &sel.ey); | 827 | getbuttoninfo(e, NULL, &sel.ex, &sel.ey); |
| @@ -2743,13 +2743,6 @@ kpress(XEvent *ev) { | |||
| 2743 | (shift ? "dacb":"DACB")[ksym - XK_Left]); | 2743 | (shift ? "dacb":"DACB")[ksym - XK_Left]); |
| 2744 | len = 3; | 2744 | len = 3; |
| 2745 | break; | 2745 | break; |
| 2746 | case XK_Insert: | ||
| 2747 | if(shift) { | ||
| 2748 | selpaste(); | ||
| 2749 | return; | ||
| 2750 | } | ||
| 2751 | memcpy(buf, xstr, len); | ||
| 2752 | break; | ||
| 2753 | case XK_Return: | 2746 | case XK_Return: |
| 2754 | len = 0; | 2747 | len = 0; |
| 2755 | if(meta) | 2748 | if(meta) |
