Hi Lars,
I'm pretty close to having a patch ready, but I'm stuck in one key spot. I don't know if anyone on the list could help?
After the user registers a hotkey, and when they press the hotkey, MacOS will run the code below. On the line "RUN_SOME_ELISP_FUNCTION", I would expect some elisp function to be run (e.g. 'emacs-version').
But no matter what I do, it always crashes the program. I think my first problem is not knowing how to call elisp (run_hooks, safe_call, etc?) correctly, but second, I suspect if this is crashing due to a threading issue.
handler = [NSEvent addGlobalMonitorForEventsMatchingMask:(NSEventMaskKeyDown) handler:^(NSEvent *event){
if (event.modifierFlags & modifier)
if([event.charactersIgnoringModifiers characterAtIndex:0] == vkey) {
RUN_SOME_ELISP_FUNCTION
[[NSApp mainWindow] makeKeyAndOrderFront:NSApp];
}
}
}];
Is there anyone who might know how to fill in this piece?
Thanks