NUMlockCALC

Post your working scripts, libraries and tools
Jive Turkey
Posts: 5
Joined: 23 Mar 2014, 00:04
Facebook: matthiew

NUMlockCALC

23 Mar 2014, 00:39

I never use the Num Lock key, so I thought I'd remap it to something useful. This script will open/close/activate calc.exe when the Num Lock key is pressed.

Code: Select all

;********************************************************************************************
; NUMlockCALC
;
; AutoHotkey Version: 1.1
; Language:           English
; Platform:           Windows Vista, 7, 8
; Author:             Jive Turkey (message me on the AHK forums or www.twitter.com/matthiew)
;
; Script Function:    Maps Num Lock key to open/activate/close calc.exe. Keeps Num Lock on.
;********************************************************************************************

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


SetNumLockState, AlwaysOn

NumLock::
	IfWinExist, Calculator
		{
		IfWinActive, Calculator
			{
			WinClose, Calculator
			}
		else
			{
			WinActivate, Calculator
			}
		}
	else
		{
		Run calc
		WinActivate, Calculator
		}
	return
Attachments
NUMlockCALC.zip
Download NUMlockCALC.exe
(529.22 KiB) Downloaded 118 times
Morpheus
Posts: 119
Joined: 04 Oct 2013, 05:09

Re: NUMlockCALC

23 Mar 2014, 05:30

You can set the hot key to open calc.exe from within the shortcut to calc.exe itself. No need for AHK.
User avatar
TheDewd
Posts: 1391
Joined: 19 Dec 2013, 11:16
Location: USA

Re: NUMlockCALC

27 Mar 2014, 08:52

Morpheus wrote:You can set the hot key to open calc.exe from within the shortcut to calc.exe itself. No need for AHK.
While you can specify a hotkey for a shortcut in Windows, I don't believe that you can use the NumLock key without using a modifier such as Ctrl+Alt+NumLock.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
Morpheus
Posts: 119
Joined: 04 Oct 2013, 05:09

Re: NUMlockCALC

27 Mar 2014, 11:43

Oh yeah. Good point. :-)

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 96 guests