What's new

Keyboard Shortcuts - V3.0 Add-On Available - see Resources

bolsover

Senior Member
If you are looking to do something complex but beautiful then take a look at these for inspiration:
https://waldobronchart.com/note/shortcut-mapper-release

@NateLiquidGravity
Long way to go but I've started work on a keyboard form..
Just creating a keyboard takes quite some effort - and I've only attempted UK English layout. Not made any effort to create/allow for different regions/languages. However, provided the physical layout does not change, changing the key letters should not be too difficult. I chose to implement the keyboard as a winform with buttons rather than an image to make binding all the text simpler.
So far, I have the keyboard with images for the key letters etc. positions in the bottom right of the key - having a problem creating some of the images (grave, apostrophe, hash) but this can wait. I have also added code to add overlay text (shortcut text) to the keys. Overlay text will be positioned top left to give most space. The next step is to test in the Alibre environment.

1699108285748.png
 

NateLiquidGravity

Alibre Super User
Nice looking keyboard - but looks expensive.
It's got me wondering if an old android tablet could be adapted to similar purpose.. Maybe a full screen 'soft' keyboard with hepatic feedback?
I tried that a couple a while back. I didn't like that the ones I tried essentially hosted a webserver on my pc to work wirelessly.
 

JimCad

Senior Member
I only use a few shortcuts.
I'd never remember more than that but what you're doing looks really good for the more advanced users.
 

Cator

Senior Member
Hi David, I just downloaded V2 and it reports these problems to you.

1I get the error of fig1 with text attached if I move the selection to Design Part Browser. The translated message says "An element with the same key has already been added". Furthermore, only in the Drawing browser selection are the shortcuts colored and written.
Error.png
2) I renew to anyone who wants to install this application to do so with administrator rights

3) When you select Shortcuts and then Keyboard the Shortcuts window fades into the background and disappears behind the Alibre window. Both windows should remain ahead of Alibre's.
I hope I have given you some indications that you can work on, thank you for this work!


in System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
in System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
in Bolsover.Shortcuts.Presenter.KeyboardPresenter.ProfileComboBox_SelectedIndexChanged(Object sender, EventArgs e) in D:\Repository\Jetbrains\Bolsover\AlibreShortcuts\AlibreShortcuts\Shortcuts\Presenter\KeyboardPresenter.cs:riga 93
in System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
in System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
in System.Windows.Forms.ComboBox.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Regards,
Francesco
 

bolsover

Senior Member
@Cator
Thanks for the feedback. I 'think' I know why this error occurs. I've already got a fix in progress. I have reproduced the problem.
Also, I'll take another look at the installer script. It should already install with admin rights — but I might be wrong.
David
 

bolsover

Senior Member
@Cator
Thanks for the feedback. I 'think' I know why this error occurs. I've already got a fix in progress. I have reproduced the problem.
Also, I'll take another look at the installer script. It should already install with admin rights — but I might be wrong.
David
My initial thought on the problem turned out to be incorrect. I had thought it was a race condition where a list of possible shortcuts was not being cleared fully before being regenerated.
It turns out the problem is much more basic and is due to a duplication of keycodes in the Alibre code that set the 'standard' list of shortcuts for the Design Boolean Editor:

My code simply reads the the user defined (or standard) shortcuts and reports. The exception was being thrown when attempting to add the duplicated code to a dictionary that does not allow for duplicates.

It seems that Alibre always accepts the last of the duplicated codes as the one to apply - so I aim to do the same.

Working up a fix now and will post an updated version later today.

Here's the offending code from within the alibre.dll file:

C#:
public class DesignBooleanProfilePrototype : ProfilePrototype
.....
 internal Profile StandardShortcuts
    {
      // Method get_StandardShortcuts with token 0600454B
      get
      {
        Profile standardShortcuts = new Profile();
        standardShortcuts.setValue("SELECTALL", 131137);
        standardShortcuts.setValue("COPY", 131139);
        standardShortcuts.setValue("OPEN_DESIGN", 131151);
        standardShortcuts.setValue("PRINT_DESIGN", 131152);
        standardShortcuts.setValue("PASTE", 131158);
        standardShortcuts.setValue("CUT", 131160);
        standardShortcuts.setValue("REDO", 131161);
        standardShortcuts.setValue("UNDO", 131162);
        standardShortcuts.setValue("DELETE", 46);
        standardShortcuts.setValue("DESIGN_PROPERTIES", 262157);
        standardShortcuts.setValue("PROFILE_OPTIONS", 196687);
        standardShortcuts.setValue("CUSTOM_ORIENTATIONS", 131157);
        standardShortcuts.setValue("ROTATION_POINTS", 131154);
        standardShortcuts.setValue("CMD_MEASUREMENTTOOL", 131149);
        standardShortcuts.setValue("EQUATION", 131141);
        standardShortcuts.setValue("TOGGLE_WORKSPACES", 131081);
        standardShortcuts.setValue("HELPITEM", 112);
        standardShortcuts.setValue("PREVIOUS_VIEW", 114);
        standardShortcuts.setValue("NEXT_VIEW", 115);
        standardShortcuts.setValue("REGENERATE_ASSEMBLY", 116);
        standardShortcuts.setValue("ZOOM_FIT", 36);
        standardShortcuts.setValue("INSERT_DESIGN", 196681);
        standardShortcuts.setValue("HIDE_SELECTION", 131144);
        standardShortcuts.setValue("TOGGLE_ANNOTATIONS", 196673);
        standardShortcuts.setValue("TOGGLE_SKETCH_DIMENSIONS", 196677);
        standardShortcuts.setValue("TOGGLE_CONSTRAINTS", 196675);   // duplicated Ctrl+Shift+C
        standardShortcuts.setValue("TOGGLE_GRID", 196679);
        standardShortcuts.setValue("TOGGLE_REDLINES", 196690);
        standardShortcuts.setValue("TOGGLE_SKETCHES", 196683);
        standardShortcuts.setValue("TOGGLE_ALLREFS", 196688);
        standardShortcuts.setValue("TOGGLE_WIREFRAME", 196695);
        standardShortcuts.setValue("CMD_ASSEMBLY_CONSTRAINTS", 196675);   // duplicated Ctrl+Shift+C
        standardShortcuts.setValue("FILE_NEW_PART", 196692);
        standardShortcuts.setValue("FILE_NEW_SHEET_METAL_PART", 196684);
        standardShortcuts.setValue("FILE_NEW_ASSEMBLY", 196674);
        standardShortcuts.setValue("FILE_NEW_DRAWING", 196676);
        standardShortcuts.setValue("FILE_NEW_BOM", 196685);
        standardShortcuts.setValue("CMD_ORIENT_FRONT", 131121);
        standardShortcuts.setValue("CMD_ORIENT_BACK", 131122);
        standardShortcuts.setValue("CMD_ORIENT_LEFT", 131123);
        standardShortcuts.setValue("CMD_ORIENT_RIGHT", 131124);
        standardShortcuts.setValue("CMD_ORIENT_TOP", 131125);
        standardShortcuts.setValue("CMD_ORIENT_BOTTOM", 131126);
        standardShortcuts.setValue("CMD_ORIENT_ISO_FRONT_NW", 131127);
        standardShortcuts.setValue("TOGGLE_POINTS", 262193);
        standardShortcuts.setValue("TOGGLE_AXES", 262194);
        standardShortcuts.setValue("TOGGLE_PLANES", 262195);
        standardShortcuts.setValue("TOGGLE_COORDINATE_SYSTEM", 262196);
        standardShortcuts.setValue("TOGGLE_ORIENTATION_GLYPH", 262197);
        return standardShortcuts;
      }
    }
 

Cator

Senior Member
Bug fix version 2.1 now available in the resources section

Or here if you prefer .. https://github.com/bolsover/AlibreShortcuts
Good evening David,
I downloaded your update.
Now the windows remain in the foreground and the buttons are displayed.

When I first logged in I got this error:
1699550732196.png


in System.ThrowHelper.ThrowKeyNotFoundException()
in System.Collections.Generic.Dictionary`2.get_Item(TKey key)
in Bolsover.Shortcuts.Presenter.KeyboardPresenter.ApplyShortcutsBasedOnKeys(Dictionary`2 shortCutList, Color backColor) in D:\Repository\Jetbrains\Bolsover\AlibreShortcuts\AlibreShortcuts\Shortcuts\Presenter\KeyboardPresenter.cs:riga 151
in Bolsover.Shortcuts.Presenter.KeyboardPresenter.ShowShortcutsByModifierType() in D:\Repository\Jetbrains\Bolsover\AlibreShortcuts\AlibreShortcuts\Shortcuts\Presenter\KeyboardPresenter.cs:riga 202
in Bolsover.Shortcuts.Presenter.KeyboardPresenter.ProfileComboBox_SelectedIndexChanged(Object sender, EventArgs e) in D:\Repository\Jetbrains\Bolsover\AlibreShortcuts\AlibreShortcuts\Shortcuts\Presenter\KeyboardPresenter.cs:riga 138
in System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
in System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
in System.Windows.Forms.ComboBox.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


I noticed that among the various options the settings relating to the sketch area are missing from the keyboard display.

Good work and regards,
Francesco
 

bolsover

Senior Member
@Cator
Thanks again for the helpful feedback. It is only the goodwill of other users that allows me to properly debug!
To be honest, I'm not certain what is causing this issue but I have just made some changes aimed at catching any errors in the ApplyShortcutsBasedOnKeys method and displaying a message box to the user indicating the possible cause of a problem.
The two possible causes I'm now checking for are:
1 The keycode for a shortcut is not in my list of possible keycodes.
2 A shortcut is mapped to a key not in a 'standard' keyboard. I'm wondering if this is a language related issue?

I will upload version 2.2 in a short while.

I have also made a number of other small changes mainly to clean up some of the code but also to make the Add-on easier to interpret.
The modifier keys selected is now shown
1699559450498.png
I've also changed the highlight colors in an effort to make the selection clearer.


David
 

bolsover

Senior Member
I'm already thinking of an update..
What do you think..
I've added to relevant Alibre icon to the shortcut button and put in a tooltip.
Should I keep the shortcut text on the buttons or keep just the text and the button letter/symbol/digit.
The issue is that a button can really only have one image and one piece of text.
I could (maybe) put the Alibre icon in the tooltip - but looks a bit tricky and I would prefer to keep on the button..


1700060446494.png
 
Top