Specialized Calculator

with AutoHotkey

by Denis Lamarre
last updated Jan 17, 2019
difficulty.png complex

by Denis Lamarre

Description

Many professionals who work with numbers keep a calculator next to their computer. Calculations can be monotonous (e.g. calculating ratios, commissions or taxes as a matter of routine). Assuming all calculations are good on the calculator, once they are transferred to the PC, a slipped keystroke can make all that work irrelevant.

Here we will show you how to create a Specialized Calculator that will calculate two taxes from a specific input amount. We will also show you how to create shortcuts that will let you quickly paste the input and tax amounts (without error) wherever you need them.

Whatever your specific calculation needs — be they taxes, mortgage rates, tips, or other — you can easily adapt this specialized calculator to make your work easier.

Steps

1

CalculatorPrepare your overlay
Choose 5 keys on the Enterpad that are close to each other. Give the keys appropriate names, like ‘Start Calc’, ‘Sub’, ‘Tax 1’, ‘Tax 2’, and ‘Total’.

- The first will start/show the calculator.
- The second will paste the amount without taxes.
- The third will paste the first tax amount.
- The fourth will paste the second tax amount.
- The last will paste the total amount with taxes.

2

Code installation
Copy/paste the following code in your AutoHotkey script template (Enterpad.ahk) at the location of the key you wish to assign for the Start Calc function.

3

Code installation
Copy/paste the following code in your AutoHotkey script template (Enterpad.ahk) at the locations of the other keys you wish to assign for the remaining functions.

003:
  SendInput %FirstTax%{Enter}
return

Of course, you will have to modify the variable name (between the percent signs) accordingly: for the Sub key, use %Amount%; for the Tax 1 key, use %FirstTax%; for the Tax 2 key, use %SecondTax%; and for the Total key, use %Total%.

More Info

With a few modifications, this script can handle any kind of calculation. The GUI lines of code create the buttons, titles, and text boxes that are used by the calculator to show data. See the AutoHotkey documentation to learn more about creating visual controls with AHK.

N.B. Pressing the ESC key while the calculator window is open will reset all fields to zero; pressing ESC twice will close the calculator.