Hey
> On 19 Sep 2016, at 22:58,
steve....@vydia.com wrote:
> Hi, I am coming from Ubuntu/Windows and used to the ctrl+x,c,v for cut copy and paste. I am already using hammerspoon for some nice window layout stuff. I would love to be able to map, for example, cmd+v to ctrl+v. Like hs.hotkey.bind("cmd", 'v', "ctrl", 'v'); But that's not what it expects. Anyone know of an easy way to to do that? If not, I guess I'll just stick around long enough to change my muscle memory.
So the first thing to note here is that you're wanting to emit a keyboard event in response to a keyboard event. If you emit the cmd-c while ctrl-c is still held down, the system is going to see cmd-ctrl-c, so we need to emit the event after you've let go of the keyboard. Fortunately, hs.hotkey.bind() can do this with its releasefn argument :)
hs.hotkey.bind({"ctrl"}, "c", nil, function() hs.eventtap.keyStroke({"cmd"}, "c") end)
Cheers,
Chris