-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I try to adapt Key chords to apply commonly used styles to Inkscape objects on macOS.
The list of key chords are shown in this graphic
The author has published his key chord setup on github https://github.com/gillescastel/inkscape-shortcut-manager for linux.
I have already managed to adapt the creation of svg snippets for pasting. The remaining issue is that defining a large overlapping set of key chords using https://github.com/knu/hs-knu/blob/master/chord.lua does not work as expected. Only a subset works.
knu = require("knu")
-- Function to guard a given object from GC
guard = knu.runtime.guard
-- Keychords (48x)
keychords = {}
-- work
keychords[1] = {"f", "space"}
keychords[2] = {"w", "space"}
keychords[3] = {"b", "space"}
keychords[4] = {"s", "space"}
keychords[5] = {"d", "space"}
keychords[6] = {"e", "space"}
-- do not work
keychords[7] = {"s", "f"}
keychords[8] = {"d", "f"}
keychords[9] = {"e", "f"}
keychords[10] = {"s", "w"}
keychords[11] = {"d", "w"}
keychords[12] = {"e", "w"}
keychords[13] = {"s", "g"}
keychords[14] = {"d", "g"}
keychords[15] = {"e", "g"}
keychords[16] = {"s", "f", "g"}
keychords[17] = {"d", "f", "g"}
keychords[18] = {"e", "f", "g"}
keychords[19] = {"s", "w", "g"}
keychords[20] = {"d", "w", "g"}
keychords[21] = {"e", "w", "g"}
keychords[22] = {"s", "v"}
keychords[23] = {"d", "v"}
keychords[24] = {"e", "v"}
keychords[25] = {"s", "f", "v"}
keychords[26] = {"d", "f", "v"}
keychords[27] = {"e", "f", "v"}
keychords[28] = {"s", "w", "v"}
keychords[29] = {"d", "w", "v"}
keychords[30] = {"e", "w", "v"}
keychords[31] = {"s", "a"}
keychords[32] = {"d", "a"}
keychords[33] = {"e", "a"}
keychords[34] = {"s", "a", "v"}
keychords[35] = {"d", "a", "v"}
keychords[36] = {"e", "a", "v"}
keychords[37] = {"s", "a", "g"}
keychords[38] = {"d", "a", "g"}
keychords[39] = {"e", "a", "g"}
keychords[40] = {"s", "x"}
keychords[41] = {"d", "x"}
keychords[42] = {"e", "x"}
keychords[43] = {"s", "x", "v"}
keychords[44] = {"d", "x", "v"}
keychords[45] = {"e", "x", "v"}
keychords[46] = {"s", "x", "g"}
keychords[47] = {"d", "x", "g"}
keychords[48] = {"e", "x", "g"}
knuchords = {}
for k, v in pairs(keychords) do
knuchords[k] = knu.chord.new({}, v, function() print(hs.inspect.inspect(v)); end, 0.5)
end
local InkscapeWF = hs.window.filter.new("Inkscape")
InkscapeWF
:subscribe(hs.window.filter.windowFocused, function()
print("starting keychords")
for k,v in pairs(knuchords) do
guard(v:start())
end
end)
:subscribe(hs.window.filter.windowUnfocused, function()
print("stopping keychords")
for k,v in pairs(knuchords) do
guard(v:stop())
end
end)@knu Do you know where the issue is located and how one could resolve it?
Metadata
Metadata
Assignees
Labels
No labels
