I prefer to use keyboard commands on MacOS as much as possible. I therefore use the Mac utility Keyboard Maestro to add my own key assignments to make up for those lacking within applications for my common tasks, increasing my productivity.
The MacOS calculator is a good example; I use it regularly, usually for simple calculations, but occasionally for more involved ones, too. For example, squaring a number has a button but no keyboard access, so I assign x² to ⇧ 2. Similarly, I assign 2x to ⌘ 2.
This set of macros provides a mostly complete set of such operations and also a few extras such as menu selections, especially where they conflict with commands I’d rather use for calculations, e.g. the Scientific view is assigned ⌘ ^ S rather than ⌘ 2.
My key assignments are in the following table, using the following symbols for key modifiers: ⇧ (shift), ⌘ (command), ^ (control), and ⌥ (option). Note that keys are indentified by capital letter (as they are on the keyboard), but are lower-case unless shifted.
Category | Symbol | Description | Key Assignment | Built-In Key? |
---|---|---|---|---|
Numbers | 0, 1, … 9 | Digits | 0, 1, … 9 | Yes |
π | 3.141… Pi | P | Yes | |
e | 2.718… Euler’s Number | E | No | |
γ | 0.577… Euler’s Constant | G | No | |
φ | 1.618… Golden Ratio | F | No | |
Rand | 0 ≤ Random Number < 1 | R | No | |
Basic Operations | – | Subtraction | - | Yes |
÷ | Division | / | Yes | |
+ | Addition | + aka ⇧ = | Yes | |
× | Multiplication | * aka ⇧ 8 | Yes | |
% | Percentage to Decimal, ÷ 100 | % aka ⇧ 5 | Yes | |
1/% | Decimal to Percentage, × 100 | ⇧ ⌥ 5 | No | |
± | Negation | ⇧ - | No | |
⌥ - | Yes | |||
Algebraic Functions | 1/x | Inverse (Reciprocal) | ⇧ / | No |
x! | Factorial | ! aka ⇧ 1 | Yes | |
EE | Scientific Notation, x × 10y | ⇧ E | Yes | |
x2 | Square | ⇧ 2 | No | |
x3 | Cube | ⇧ 3 | No | |
xy | Power (Exponentiation) | ^ aka ⇧ 6 | Yes | |
√x | Square Root | ⇧ ⌥ 2 | No | |
∛x | Cube Root | ⇧ ⌥ 3 | No | |
y√x | yth Root | ⇧ ⌥ 6 | No | |
Exponential & Logarithmic Functions | 10x | Power of 10 | ⌘ 1 | No* |
2x | Power of 2 | ⌘ 2 | No* | |
yx | Power of y | ⌘ 6 | No | |
ex | Exponential Function | ⌘ E | No | |
log₁₀ | Logarithm Base 10 | ⌘ ⌥ 1 | No | |
log₂ | Logarithm Base 2 | ⌘ ⌥ 2 | No | |
logy | Logarithm Base y | ⌘ ⌥ 6 | No | |
ln | Natural Logarithm Base e | ⌘ ⌥ E | No | |
Trignometric Functions | sin | Sine | ⇧ S | No |
cos | Cosine | ⇧ C | No | |
tan | Tangent | ⇧ T | No | |
sin⁻¹ | Inverse Sine | ⇧ ⌥ S | No | |
cos⁻¹ | Inverse Cosine | ⇧ ⌥ C | No | |
tan⁻¹ | Inverse Tangent | ⇧ ⌥ T | No | |
Hyperbolic Trignometric Functions | sinh | Hyperbolic Sine | ^ S | No |
cosh | Hyperbolic Cosine | ^ C | No | |
tanh | Hyperbolic Tangent | ^ T | No | |
sinh⁻¹ | Inverse Hyperbolic Sine | ^ ⌥ S | No | |
cosh⁻¹ | Inverse Hyperbolic Cosine | ^ ⌥ C | No | |
tanh⁻¹ | Inverse Hyperbolic Tangent | ^ ⌥ T | No | |
Bitwise Operations | AND | And | & aka ⇧ 7 | Yes |
OR | Or | | aka ⇧ \ | Yes | |
XOR | Exclusive Or | ^ aka ⇧ 6 | No* | |
NOR | Nor | ↓ | No | |
1's | 1's Complement (NOT) | ~ aka ⇧ ` | No* | |
2's | 2's Complement | ` | No | |
<< | Shift Left 1 Bit | < aka ⇧ , | Yes | |
>> | Shift Right 1 Bit | > aka ⇧ . | Yes | |
<< y | Shift Left y Bits | ⌘ , | No | |
>> y | Shift Right y Bits | ⌘ . | No | |
RoL | Rotate Left 1 Bit (Double) | ← | No | |
RoR | Rotate Right 1 Bit (Halve) | → | No | |
! aka ⇧ 1 | Yes | |||
Numeration Bases and Character Encodings |
8 | Base 8 | ⌘ ^ 8 | No |
10 | Base 10 | ⌘ ^ 0 | No | |
16 | Base 16 | ⌘ ^ 6 | No | |
8 10 16 | Step Through Bases: 8 to 10 to 16 to 8 | R | Yes | |
Binary | Show or Hide Binary Encoding | ⌘ B | No | |
ASCII | Show or Hide ASCII Encoding | ⌘ A | No | |
Unicode | Show or Hide Unicode Encoding | ⌘ U | No | |
Controls | = | Equals (Evaluate) | = or return | Yes |
C | Clear Entry | C or esc | Yes | |
C C | Clear Calculation | C C or esc esc | Yes | |
Rad ↺ Deg | Radians ↺ Degrees Toggle | D | No | |
mc | Memory Clear | X | No | |
m+ | Memory Addition | A | No | |
m- | Memory Subtraction | S | No | |
mc m+ | Memory New | N | No | |
mr | Memory Recall | M | No | |
Views | Basic | Basic Operations only | ⌘ ^ B | No* |
Scientific | Full-Featured Decimal Calculator | ⌘ ^ S | No* | |
Programmer | Useful Operations for Programming | ⌘ ^ P | No* |
- *Avoid system-wide key assignments, and leave all of the calculator’s existing key assignments in place if possible.
- The major exception here is that Apple assigns unshifted E to the natural logarithm function, while I assign that to the constant e, and instead use ^ ⌥ E for natural logarithm (since I assign ^ E to the exponential function). This is more in keeping with the other assignments for operations.
- The other major exception are the keys for bitwise operations, which when assigned often don’t use the operators I’m familiar with from C-flavored languages. So XOR is reassigned to ^ so that ~ can be used for 1's Complement (NOT).
- The last exception is the assignments for views, which as noted above use command keys I’d rather use for calculations. My general pattern for views or windows within an application is also to use the modifiers ⌘ ^, so that shows up here, too, along with more memorable letter choices. I also use this pattern for numeration bases in the programmer view, i.e. octal, decimal, and hexadecimal.
- Otherwise follow existing patterns for key choices.
- Numbers: Digits are both buttons and the obvious keys, but the button π is also assigned to P, so I also use unmodified keys for other values, both for existing buttons without keys like e and Rand, and for a couple more I provide.
- Controls: Clear is assigned C and Equals is assigned =, so I also use unmodified keys for other controls such as the memory controls and the radians / degree toggle.
- Basic Operations and Algebraic Functions: Many of these have buttons that also work with shifted keys, e.g. +, ^, and scientific notation, so I continue that pattern for buttons without assigned keys like inverse (⇧ /) and square (⇧ 2 — perfect symbol for “raising to the power of 2“). I also add other common functions in this family, notably negation (⇧ -), which already exists as ⌥ -, but the latter doesn’t follow the pattern and so is harder to remember (I do leave it in place, though).
- Exponential & Logarithmic Functions: With both x² and 2x referencing 2, the latter and other more complicated functions require a different modifier, so I use the command key ⌘.
- Trignometric Functions: I use ⇧ S, ⇧ C, and ⇧ T for sine, cosine, and tangent.
- Use other modifiers when necessary and in a consistent fashion:
- Inverse Operations: I use the option key in general as an “inverse” key, so, for example square root is ⇧ ⌥ 2, and inverse sine is ⇧ ⌥ S .
- Hyperbolic Trignometric Functions: For these less common functions, to be consistent with the circular trignometric functions and avoid collisions with the keys for Save, Copy, and Show Paper Tape, I use the same letters but instead use ^ : ^ S, ^ C, and ^ T.
These macros work with MacOS 12 Monterey, and probably with later versions, too; earlier versions may be missing some functions.
It took a while to figure out what all of the button names are, and I can thank several people in the Keyboard Maestro forums for their assistance.