Specialized Calculator

with AutoHotkey

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

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, one accidental 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 accurately 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 them 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 and 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 and 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 names (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

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

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.