aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-01-05 01:02:12 -0500
committerB. Watson <urchlay@slackware.uk>2024-01-05 01:02:12 -0500
commit9c82407421474993b8c18c84866bda3a607f59cb (patch)
tree09e53445fc8d87c58eb2c4d03d45b853049d845c
parent9d15984ebb9dab26de18a5ed633f23ad869af48f (diff)
downloadhcalc-9c82407421474993b8c18c84866bda3a607f59cb.tar.gz
Make shift-insert paste (like ^V).
-rw-r--r--hcalc.18
-rw-r--r--hcalc.h2
-rw-r--r--hcalc.rst6
-rw-r--r--setupx.c4
4 files changed, 13 insertions, 7 deletions
diff --git a/hcalc.1 b/hcalc.1
index e6ea5ea..4fa1bbf 100644
--- a/hcalc.1
+++ b/hcalc.1
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
-.TH "HCALC" 1 "2024-01-04" "1.2u1" "Urchlay's Misc Stuff"
+.TH "HCALC" 1 "2024-01-05" "1.2u1" "Urchlay's Misc Stuff"
.SH NAME
hcalc \- graphical hex calculator
.\" RST source for hcalc(1) man page. Convert with:
@@ -182,11 +182,11 @@ the same as \fIM\fP, \fIMR\fP, and \fIM+\fP on \(aqpocket\(aq calculators.
.TP
.B \fB^C\fP
Copy the current number to the X selection
-buffer. Same as clicking mouse button 1 (usually left) on the number.
+buffer. Same as clicking mouse button 1 (usually left) on the number display.
.TP
-.B \fB^V\fP
+.B \fB^V\fP \fBShift\-Insert\fP
Paste from the X selection buffer.
-Same as clicking a mouse button other than 1 (right\-clicking) on the number.
+Same as clicking a mouse button other than 1 (right\-clicking) on the number display.
.TP
.B \fBq\fP
Quiet. Toggles the audible bell.
diff --git a/hcalc.h b/hcalc.h
index ce43621..6d0d568 100644
--- a/hcalc.h
+++ b/hcalc.h
@@ -59,5 +59,7 @@ void load_config(void);
void save_config(void);
void show_value();
void bell(void);
+void copy(void);
+void paste(void);
#define MAXCHARS 15
diff --git a/hcalc.rst b/hcalc.rst
index 4b3fba3..2f900b5 100644
--- a/hcalc.rst
+++ b/hcalc.rst
@@ -170,11 +170,11 @@ KEYBOARD
**^C**
Copy the current number to the X selection
- buffer. Same as clicking mouse button 1 (usually left) on the number.
+ buffer. Same as clicking mouse button 1 (usually left) on the number display.
-**^V**
+**^V** **Shift-Insert**
Paste from the X selection buffer.
- Same as clicking a mouse button other than 1 (right-clicking) on the number.
+ Same as clicking a mouse button other than 1 (right-clicking) on the number display.
**q**
Quiet. Toggles the audible bell.
diff --git a/setupx.c b/setupx.c
index f905776..34f0682 100644
--- a/setupx.c
+++ b/setupx.c
@@ -138,6 +138,10 @@ process_input()
case XK_F4:
key('B');
break;
+ case XK_Insert:
+ if(event.xkey.state & ShiftMask)
+ paste();
+ break;
}
}
break;