-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proof of concept implementation of keyboard shortcuts for palette tools (#985) #994
Conversation
Hi, thanks for your PR. I'll take a look at it soon. Could you summarise what this does and how? |
The Setting the active tool is done by traversing the hierarchy of The rest of the changes support the above in a manner that seemed to be in keeping with the existing design. For example, The key chord for each palette entry (if one exists) is now part of the hint/hover text for the palette entry. e.g. if you hover over a Business Actor the text will say "Business Actor (ba) - ArchiMate Element", the parenthesized text is the key chord. To activate the tool from the keyboard just press "b" then "a". I tried to make the key chords consistent and memorable. All elements in the same layer start with the same letter, with a notable exception for technology which I decomposed into technology and physical. The consistent keys are used to activate similar concepts across layers. For example, business process is activated with "bp", application process is activated with "ap", technology process is activated with "tp", etc. This consistency comes at the slight cost of discoverability for some elements. A notable example is a technology node which one might infer is "tn" but is actually "to". I can explain my reasoning for why the key chords are as they are but that's probably not of interest. One thing to keep in mind is that after a tool is activated using the keyboard shortcut the pointer needs to be moved in order for the cursor to change on screen. |
Thanks. Leave it with me (might not be straight away). |
Hi, I've looked at your code now. Thanks for the work that you put into this, you've obviously figured out how a lot of the code works and is structured. Your approach is logical in several ways - using the various However, one downside is that the key combinations are hard-coded and not user-configurable. I can imagine that some users would want to customise these key sequences. Another problem is that the key sequences can conflict with user-defined key shortcuts. These can be configured in Archi's Preferences under "System" and "Keys". There, I added a shorchut combination of "ba" for a command. This over-rode the palette key chord for Business Actor (expected) but none of the other key chords that started with the "b" character worked ("br", "bb", etc). It's possible that some of these hard-coded key sequences will conflict with users' custom key combinations. I wonder whether it would be possible to use the Eclipse Command framework ( I did something similar for jArchi by declaring a parameterized Command, see here and here |
Thanks for reviewing this pull request. The items you've raised bothered me as well. When I first started looking into implementing this PoC I recall seeing that there was a right way to implement commands and shortcuts but I was concerned I'd end up spending lots of time debugging configuration only to find out that what I wanted to do wasn't possible. When I get some spare time I'll take a look at the Eclipse Command Framework and the parameterized command you've implemented to see if I can do something similar. |
@bkyle I've been experimenting somewhat with the Command Framework and will also do some more experiments. I think if we take a bit more time over this, we should come up with a solution. |
@bkyle I've pushed a new branch called palette-keys with a basic implementation of using the Eclipse Command and Key Binding framework. Caveats:
|
This looks great!
I ran into this too and was exploring the use of a custom context so that the command handler would only be invoked in relevant situations. |
We're on the same page. I looked into using the
|
I've force pushed the |
Great minds think alike 😄
Some ideas I had to address this are below. If either of these seem plausible I'd be happy to look into them further. I mention them because you may know if they are dead ends.
|
This is solved now. The key binding has to be set to the "In Archi Diagrams" context. |
No description provided.