Skip to content

Commit

Permalink
πŸŽ¨βž•πŸ“
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrudolph committed Jun 20, 2018
1 parent fc4535f commit 1799676
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hammerspoon/tap-modifier-for-hotkey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ modal.new = function(modifier)
reset = function(self)
-- Keep track of the three most recent events.
self.eventHistory = {
fetch = function(self, index)
if self[index] then
return eventtap.event.newEventFromData(self[index])
end
end,

-- Serialize the event and push it into the history
push = function(self, event)
self[3] = self[2]
self[2] = self[1]
self[1] = event:asData()
end,

-- Fetch the event (if any) at the given index
fetch = function(self, index)
if self[index] then
return eventtap.event.newEventFromData(self[index])
end
end
}

Expand Down

0 comments on commit 1799676

Please sign in to comment.