We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc4535f commit 1799676Copy full SHA for 1799676
βhammerspoon/tap-modifier-for-hotkey.luaβ
@@ -19,16 +19,18 @@ modal.new = function(modifier)
19
reset = function(self)
20
-- Keep track of the three most recent events.
21
self.eventHistory = {
22
- fetch = function(self, index)
23
- if self[index] then
24
- return eventtap.event.newEventFromData(self[index])
25
- end
26
- end,
27
-
+ -- Serialize the event and push it into the history
28
push = function(self, event)
29
self[3] = self[2]
30
self[2] = self[1]
31
self[1] = event:asData()
+ end,
+
+ -- Fetch the event (if any) at the given index
+ fetch = function(self, index)
+ if self[index] then
32
+ return eventtap.event.newEventFromData(self[index])
33
+ end
34
end
35
}
36
0 commit comments