Skip to content

Commit 1799676

Browse files
committed
πŸŽ¨βž•πŸ“
1 parent fc4535f commit 1799676

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

β€Žhammerspoon/tap-modifier-for-hotkey.luaβ€Ž

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ modal.new = function(modifier)
1919
reset = function(self)
2020
-- Keep track of the three most recent events.
2121
self.eventHistory = {
22-
fetch = function(self, index)
23-
if self[index] then
24-
return eventtap.event.newEventFromData(self[index])
25-
end
26-
end,
27-
22+
-- Serialize the event and push it into the history
2823
push = function(self, event)
2924
self[3] = self[2]
3025
self[2] = self[1]
3126
self[1] = event:asData()
27+
end,
28+
29+
-- Fetch the event (if any) at the given index
30+
fetch = function(self, index)
31+
if self[index] then
32+
return eventtap.event.newEventFromData(self[index])
33+
end
3234
end
3335
}
3436

0 commit comments

Comments
Β (0)