SetWorkingDir %A_ScriptDir% switch=0 ;Used to facilitate toggling hotkey status ;The following line reads from the numpad-keys.ini file IniRead, myTime, numpad-keys.ini, Options, myTime ;If the ini file does not exist a reminder beep every 30 seconds is set IfNotExist numpad-keys.ini { myTime = 3 ;The default item in the duration listbox } Gosub, helpMe ;Reveals the opening page /::AppsKey ;Remaps the slash key to the Application key n::Ins ;Remaps n to the insert key etc etc m::Numpad0 ,::NumpadDot .::NumpadDel j::Numpad1 k::Numpad2 l::Numpad3 `;::NumpadAdd u::Numpad4 i::Numpad5 o::Numpad6 p::NumpadSub 7::Numpad7 8::Numpad8 9::Numpad9 +7::Numlock #z:: Suspend, Toggle ;Windows-z Toggles hot keys on or off SetTimer, remindMe, off If switch=0 { switch=1 ;Hotkeys on when switch = 0 and off when 1 ;The following 3 lines play a 300hz tone for 300milliseconds, waits for 50 milliseconds and plays a 200hz tone for 300 milliseconds SoundBeep, 300, 300 Sleep, 50 SoundBeep, 200, 300 } Else { switch=0 SoundBeep, 700, 700 ;Plays a 700hz tone for 700 milliseconds If rembeeps = 1 ;Reminder beeps are active { SetTimer, remindMe, on ;Turns on reminder beeps when reactivating numpad keys } } Exit +#z:: finish: Suspend, permit ;/Exempts this section from hotkey suspension MsgBox, , ,Closing numpad keys script,3 ;Gives the closing message for 3 seconds ExitApp Return #h:: HelpMe: Gui, font, s14, arial Gui, Add, Text, ,Andrew's numpad script version 2.2 Gui, add, text, vtimeprompt, Choose duration of reminders Gui, add, Listbox, vduration AltSubmit choose%myTime%, None|15 seconds|30 seconds| 1 minute|2 minutes Gui, Add, Button, gSavetime ,Save settings Gui, Add, Text, ,A list of reassigned keys follows Gui, Add, Listbox, ,n = insert|m = numpad 0|comma (,) = numpad dot (.)|fullstop (.) = numpad delete|slash (/) = application key|j = numpad 1|k = numpad 2|l = numpad 3|semicolon = numpad plus (+)|u = numpad 4|i = numpad 5|o = numpad 6|p = numpad minus (-)|7 = numpad 7|8 = numpad 8|9 = numpad 9|shift-7 = numlock (toggles)|Windows-z toggles numpad keys on and off`nTwo descending tones when turned off and a single higher tone when turned on|Windows-shift-z closes the script altogether|Windows-h reopens this page Gui, Add, Button, default, OK Gui, Add, Button, ,Close Gui, Show return ButtonClose: Gosub, finish ButtonOK: Gui, Submit Gui, destroy Gosub, Savesettings ;To check whether the ini file needs to be updated If duration = 1 { rembeeps = 0 } Else { rembeeps = 1 } If duration = 2 { recur = 15000 ;Sets duration of reminder beeps to 15 seconds } Else if duration = 3 { recur = 30000 ;Sets duration to 30 seconds } Else if duration = 4 { recur = 60000 ;Sets duration to 1 minute } Else recur = 120000 ;Sets duration to 2 minutes If rembeeps = 1 ;A duration other than none has been selected { SetTimer, remindMe, %recur% } Else if rembeeps = 0 { SetTimer, remindMe, off } Return Savetime: watching = 1 ;Tis subroutine called when Save settings button is pressed Return Savesettings: If watching = 1 ;The Save settings button has been pressed so the ini file is rewritten { Iniwrite, %duration%, numpad-keys.ini, Options, myTime watching = 0 ;Reset to avoid unwanted updating of the ini file } Return remindMe: ;This subroutine generates the reminder beeps SoundBeep,1500, 30 ;Plays a 1500hz tone for 30 milliseconds Sleep, 30 ;Pauses for 30 milliseconds SoundBeep, 1500, 30 Return