Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua

Home Page:http://www.hammerspoon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shift agruments in `hotkey.new`

minhtung0404 opened this issue · comments

If I understand correctly, if I put explicitly message = nil in the function call then it still shift the arguments, which might lead to unexpected behavior. For example if I call hotkey:bind(mods, key, nil, f1, f2, f3), it shift pressedfn to nil, releasedfn to f1 and repeatfn to f2.

  if message==nil or getFunc(message) then
    repeatfn=releasedfn releasedfn=pressedfn pressedfn=message message=nil -- shift down arguments
  end

link to code