intrusiveCALC

Post your working scripts, libraries and tools
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

intrusiveCALC

23 May 2016, 07:46

Image
Hello everyone! I'm having fun with AHK for a while now, but till now I didn't really make anything to share, so I remained silent most of the time. Months ago I got an idea to have a fancy calculator which will allow a user to type an expression and will finish it, which is very convenient for someone who often uses [WIN]+[R], "calc" and a lot of copy pasting in between. I searched if such Autohotkey script already exists and to my surprise it didn't and I would only stumble upon scripts which open a dialog window to input an expression, and this kind of defeats the purpose. I finally found a script by, I think, Laszlo, which would activate itself upon using a backtick character, but I was already working on my own, which I think has a superior design of being intrusive - the idea behind that is that you simply don't need to remember how to use your calculator or that you even have it - once you type an expression, a tooltip will popup with the answer, regardless if you want it or not - hence the name.

Initially I based my project on Autocomplete script, which works in a very similar way, except with word autocompletion. I also used Laszlo's regexp for math expression solving, so big thanks to Laszlo and Uberi for helping with a start.

I don't want to bore you any longer, so I'll just share the link, and if you're not "meh" about it, then I can talk a little bit more about stuff like security issues (basically it can display a password in rare situations), design choices (why multiplication by juxtaposition is disabled) etc.

https://bitbucket.org/Waetherman/intrusive-calc/

To use: just run the script and type 2+2
Last edited by waetherman on 29 May 2016, 16:24, edited 2 times in total.
Image
guest3456
Posts: 2519
Joined: 09 Oct 2013, 10:31

Re: intrusiveCALC

23 May 2016, 09:52

nice to see someone including unit tests, good work!

Guest888

Re: intrusiveCALC

23 May 2016, 14:40

Tray Icon cannot be loaded.
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: intrusiveCALC

23 May 2016, 15:13

Thanks Guest3456 for your opinion! I hope there will be more people interested.

Guest888, what AHK version are You using? Have you tried to download all the files? Because this is not a single file script, you need at least intrusiveCalc.ahk and Calc.ahk + icon.ico for the tray icon. Alternatively you can just go to the download page and download the archive with exe file:
intrusive-calc.zip (404 KB)
https://bitbucket.org/Waetherman/intrus ... e-calc.zip
Image
Guest888

Re: intrusiveCALC

23 May 2016, 20:38

There are only two files inside of the zip: IntrusiveCalc.exe and readme.md. There are no AHK files and the icon.
Guest888

Re: intrusiveCALC

23 May 2016, 20:43

I downloaded the source code and the icon. Thanks a lot! :thumbup:
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: intrusiveCALC

24 May 2016, 03:53

Do you enjoy it, Guest888? Thank you for finding out the bug, I took for granted that the icon is inserted in compile file, but apparently I misunderstood the docs on that matter.

I already fixed the bug. You can download the updated executable, which will work as a single file now, so you can put it into your autostart folder for your convenience
intrusive-calc.zip (404 KB)
https://bitbucket.org/Waetherman/intrus ... e-calc.zip
Image
User avatar
Pinkfloydd
Posts: 104
Joined: 13 Apr 2014, 18:32
Location: Argentina

Re: intrusiveCALC

24 May 2016, 22:33

Nice script, I'm gonna use it

As I have a spanish keyboard I don't have a direct key for the elevation symbol ^
and if I type ALT+94 does not work doing that
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: intrusiveCALC

25 May 2016, 05:08

Pinkfloydd wrote:Nice script, I'm gonna use it

As I have a spanish keyboard I don't have a direct key for the elevation symbol ^
and if I type ALT+94 does not work doing that
Input methods are my concern for a while now, as I haven't really investigated this script's compatibility with other scripts. I see two problems for now:
1. It seems that if you register a hotkey with a tilde ~ (to not cancel out the default behavior) then keypresses generated by AHK will be ignored by this hotkey. I think I'll try to solve it by removing ~ chars and avoid circular references in a different way
2. When you type a key with ALT, e.g. an exclamation mark ! with ALT+33, then the exclamation mark hotkey will not be called. I'll try to fix it by registering ALT DOWN, then logging numbers until ALT is released, then manually inserting a unicode character with this key code.

Before I do this I'll ask here on forums if I'm not missing an easier way, so please be patient. Meanwhile you could use a workaround by changing the exponentation character to something you have on your keyboard. To do this, you need to download the source and edit Calc.ahk on line 42:

Code: Select all

static CHAR_EXPONENTATION := "^"
Since it's AHK forum, I assume you know how to do this - otherwise write here and I'll assist.
Image

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 19 guests