cristianpjensen / inkscape-figures-manager-rs

Shortcuts for making technical figures fast in Inkscape, in macOS.
9 stars 1 forks source link

Shortcuts manager #6

Closed anandkumar89 closed 6 months ago

anandkumar89 commented 6 months ago

Hi,

I noticed you were trying to create a shortcut manager. I've created something similar for Mac-OS here

Haven't added README yet, but until now I'm able to

In case you want to try it out you would need to install PyObjC and PyObjC-core that allows system level keytaps for macOS. Run the main file after the inkscape window is open and rest of you'll be getting a verbose output in terminal.

For some reason, it was working from vscode but not from terminal (haven't tried again). So if program is crashing in terminal, launch it from vs-code. Mac may prompt for accessibility permission as vs-code will be listening to keytaps.

In a week or so I'll be modifying the code and making it more organised. If you want to take join along, we could share the efforts and I could give you a quick rundown of how it works. Let me know!

anandkumar89 commented 6 months ago

Yup, noticed the readme in repo now. Glad you finished it. Let me check this then!

cristianpjensen commented 6 months ago

Hey @anandkumar89. Your project looks really cool and seems to have more features than mine. I do not have the time at the moment to add these features to my implementation. However, at some point, I plan to add custom styles and reusable objects, as you are planning to.

A difference between my project and the original by Gilles Castel is that I changed how the keyboard shortcuts work. I found that the key-chords often interfered with my workflow. So, instead, I implemented it that ALT/OPT must be held while changing styles. To achieve this, I had to block all other shortcuts involving ALT/OPT. So, I also plan to make it possible to change all the shortcuts as desired, since the choice at the moment is pretty specific to my usecase.

anandkumar89 commented 6 months ago

liked the implementation in rust - mostly as it allows packaging as standalone binary. With python, although most of dependencies are c-based and system level, it much difficult to have small package or often a standalone package.

However, It seems you're blocking all shortcuts. I approach it is same way Gilles work, capture the keys - if I don't use the tapped keys then passthrough to the system, otherwise just don't return any keypresses. Rust may have some library that interact with Quartz in Mac - would allows you to do exactly same. Can't say much as have near zero experience with Rust.

I'll watch the repo anyway! Great work, keep it up.

Edit : Quick search and can't find Quartz framework wrapper/support in rust yet.