geekhack

geekhack Community => Keyboards => Topic started by: Jixr on Thu, 24 October 2013, 13:16:34

Title: Helpl with autohotkey
Post by: Jixr on Thu, 24 October 2013, 13:16:34
I'm looking for a way within autohot key to basically disable or turn my "num lock" key into something else.
But I still want num lock to be on so I can use the numbered keypad.

any ideas or anyone have a script?
Title: Re: Helpl with autohotkey
Post by: Daniel Beardsmore on Thu, 24 October 2013, 16:51:07
Convert num lock into the letter A:

NumLock::A

Convert num lock into left shift:

NumLock::LShift

The state of number lock doesn't depend on whether the key is still working; you just can't change the state with that key while the script is running.
Title: Re: Helpl with autohotkey
Post by: ijprest on Thu, 24 October 2013, 21:54:20
You can also put this at the very top of the file (in the "auto-execute" section).  It does exactly what it says.

Code: [Select]
SetNumLockState, AlwaysOn
return


Personally, I like to use Num Lock to show/hide an instance of the Calculator app.

Code: [Select]
WinToggle(Title,EXE) {
  DetectHiddenWindows, on
  If WinExist(Title) {
    If WinActive(Title) {
      WinMinimize
      WinHide
    } else {
      WinShow
      WinActivate
    }
  } else {
    Run %EXE%
  }
}

NumLock::WinToggle("Calculator","Calc")
Title: Re: Helpl with autohotkey
Post by: laffindude on Thu, 24 October 2013, 23:29:56
You can also add "SetNumLockState, AlwaysOn" in the autoexec section to lock it on when you run the script.