aboutsummaryrefslogtreecommitdiff
path: root/hcalc.rst
blob: ef7a715921af24e87c8dadb431765111e7392732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
.. RST source for hcalc(1) man page. Convert with:
..   rst2man.py hcalc.rst > hcalc.1

.. |version| replace:: 1.2u1
.. |date| date::

=====
hcalc
=====

------------------------
graphical hex calculator
------------------------

:Manual section: 1
:Manual group: Urchlay's Misc Stuff
:Date: |date|
:Version: |version|

SYNOPSIS
========

hcalc [*-default*] [*-small* | *-medium* | *-large*] [*-dec* | *-hex* | *-oct* | *-bin* ] [*-quiet*] [*--version*] [*--help*]

DESCRIPTION
===========

**hcalc** is a small (137x174 pixels minimum) TI Programmer II
semi-clone for Unix/X11 and Windows 95/NT. It doesn't take up much
space, and supports decimal, hex, binary, and octal modes.

**hcalc** is operated with the mouse and/or keyboard. See **MOUSE** and
**KEYBOARD** sections, below.

OPTIONS
=======

Options listed as (persistent) get saved to the config file, so
they'll still apply the next time **hcalc** is started. This applies
not only to command-line arguments; the settings get saved if they're
changed via the mouse or keyboard, too.

**-small**
            Display in a 125x147 window (persistent).

**-medium**
            Display in a 250x294 window (persistent).

**-large**
            Display in a 500x588 window (persistent). This is the default.

**-dec**
            Start up in decimal mode (persistent). This is the default.

**-hex**
            Start up in hexadecimal mode (persistent).

**-oct**
            Start up in octal mode (persistent).

**-bin**
            Start up in binary mode (persistent).

**-default**
            Do not read the config file on startup. *NOTE:* This option must
            be the first on the command line, or it will be ignored!

**-quiet**
            Do not ring the X bell on invalid input (persistent).

--version   Output version number and exit.

--help
            Output usage string and exit.

DISPLAY
=======

The numeric display is limited to 15 digits in decimal, hex, or octal
base. In binary mode, it displays 32 bits, but uses narrow "ticks"
rather than 0 and 1.

In hex mode, the number in the display will always be prefixed with
"0x". In octal mode, it will always be prefixed with "0". In decimal
mode, there is no prefix.

In case of error (e.g. division by zero), the display will show a
lowercase "f" in decimal mode, or only the prefix in hex or octal
mode, or all 0 bits in binary mode. When this happens, you may have to
press **CLR** or **Escape** to recover.

MOUSE
=====

Mouse operation is simple: for the most part, just click on the
buttons to press them.

There's no *%* button for the modulus operator, but you can
right-click on the *รท* (division) key.

Right-clicking (or any button other than 1) on the *CLR* key exits
**hcalc**.

For the numeric display, clicking button 1 (usually the left one)
copies the number to the X selection buffer. Clicking any other
button pastes from X, but beware: pasting anything but a number in
the current base might have unexpected effects, because all pasted
characters are treated as keystrokes (so, e.g. pasting a capital Q
quits the application). This can be useful, e.g. if you paste "2+2=",
**hcalc** will display "4".

KEYBOARD
========

**0-9**, **a-f**
            Digits. Lowercase only for the hex digits. Entering digits
            larger than the current number base is impossible (e.g. hex digits
            when in decimal mode, or digits other than 0 or 1 in binary mode) and
            will be ignored.

**+** **-** **\*** **x** **/** **%**
            Arithmetic: addition, subtraction, multiplication, division, modulus. Note that
            **x** is the same as **\***.

**.**
            Decimal point. Only works in decimal mode (base 10); other bases
            are integer-only.

**_**
            Invert sign. The *+/-* key.

**=** **Enter**
            The *=* key (equals).

**&** **|** **^** **~**
            Boolean operations. AND, OR, XOR, NOT (unary).

**<** **>**
            Bit shifts, unary. Left 1 bit, right 1 bit.

**S**
            *SHF* key: shift left/right by some number of bits (binary
            operation, like addition). Shifts left for positive
            numbers and right for negative. This is less confusing
            than it sounds: 1 shifted left once is 2, -1 shifted right
            once in -2.

**Backspace** **Delete**
            *DEL* key: delete the rightmost digit.

**C** **Escape**
            *CLR* key: clears the number.

**D** **H** **O** **B**
            Set the number base to decimal, hex, octal, or binary. The
            number currently displayed is converted into the new base.
            These are capital letters (hold down Shift).

**F1** **F2** **F3** **F4**
            Same as **D** **H** **O** **B**.

**[** **]** **}**
            *STO* (store number), *RCL* (recall stored number), *SUM*
            (add current number to stored number). *STO*, *RCL*, and *SUM* are
            the same as *M*, *MR*, and *M+* on 'pocket' calculators.

**^C**
            Copy the current number to the X selection
            buffer. Same as clicking mouse button 1 (usually left) on the number.

**^V**
            Paste from the X selection buffer.
            Same as clicking a mouse button other than 1 (right-clicking) on the number.

**q**
            Quiet. Toggles the audible bell.

**Q** **^Q**
            Quit **hcalc**. Capital letter, so press Shift. Control-Q does
            the same thing.

**z**
            Zoom: change window size. Alternates between the 3 sizes: **-small**,
            **-medium**, **-large**.

.. other sections we might want, uncomment as needed.

FILES
=====

**$HOME/.hcalc.cfg**
            Config file. This is a binary file, not human-readable, and not
            portable across architectures. It gets read on startup (unless
            **-default** is given) and written on exit. It stores the
            number base, window size (as set on the command line),
            the number that was displayed on exit, the contents of the
            *STO* memory, and the **-quiet** flag.

            Some care is taken to make sure a config file from a different
            architecture won't be used.

            Since the config file isn't human-readable, an easy way to
            create one is to run **hcalc** with **-default** plus your preferred
            options. Example::

              hcalc -default -quiet -large -hex

            ...which will kill any existing config file, and create a new one
            that stores the options you gave. Now when you run **hcalc** with
            no options, it will start up in hex mode, in a large window, and won't
            ring the bell.

            An even easier way is just to run **hcalc** and use the controls to
            set the number base, size, and quiet flag. These settings automatically
            get saved to the config file.

ENVIRONMENT
===========

**HOME**
            Config file is searched for here. If this is not set, or can't be
            read, no config file will be read or written.

**DISPLAY**
            X display to use.

.. EXIT STATUS
.. ===========

.. BUGS
.. ====

.. EXAMPLES
.. ========

COPYRIGHT
=========

**hcalc** is released under the terms of the GNU GPL.

AUTHORS
=======

**hcalc** was originally written by DJ Delorie, modified by
Theodore Kilgore, and modified again by B. Watson, who also
wrote this man page.

SEE ALSO
========

**xcalc**\(1)