xarial / xcad

Framework for developing CAD applications for SOLIDWORKS, including add-ins, stand-alone applications, macro features, property manager pages, etc.
https://xcad.net
MIT License
126 stars 25 forks source link

Assign keyboard shortcut for commands #93

Open andrMollo opened 1 year ago

andrMollo commented 1 year ago

As per title, is it possible to assign a user-defined keyboard shortcut to commands added via xCAD?

artem1t commented 1 year ago

Yes, it should be possible just as with any other standard command in SW

andrMollo commented 1 year ago

Thanks for the reply. I thought of writing directly to the registry key as suggested here, because I don't think there is an API method to do it. It would be awesome if xCAD could implement it.

artem1t commented 1 year ago

Ah, sorry, you mean you want to assign this from the code, not by the user, right?

andrMollo commented 1 year ago

Yes, l'm sorry if it wasn't clear. I'm using your framework to create an addin with some button to lunch VBA macros (like your toolbar+ that I'm not allow to use at my company). If I were able to assign shortcut with the code I could standardize the user experience for all users. I have not tried to assign a shortcut to a button via the SW user interface.

andrMollo commented 1 year ago

Hello! I was able to add keyboard shortcuts via the SolidWorks user interface, that's awesome. I you prefer I can close the issue.

andrMollo commented 7 months ago

Hi! Sorry to bring it up again. I was able to assign shortcuts via the SolidWorks user interface but sometimes they get switched.

I can't pin-point why, but the shortcut I assigned to a command of the add-in is then assigned to another one.

Can you help me or show me an area in which I can investigate the issue? Right now I'm clueless.

Thanks!