Skip to content
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

AccuDrawKeyboardShortcuts and FrameworkAccuDraw issues... #1189

Open
bbastings opened this issue Jan 21, 2025 · 0 comments
Open

AccuDrawKeyboardShortcuts and FrameworkAccuDraw issues... #1189

bbastings opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@bbastings
Copy link
Contributor

Describe the bug

The following AccuDraw shortcuts are not conditional on the current compass mode. When used AccuDraw will automatically switch to the appropriate compass mode, i.e. if you Lock X in Polar mode, AccuDraw changes to Rectangular.

KeyboardShortcutUtilities.createForTool("x", AccuDrawSetLockXTool, {isHidden: FrameworkAccuDraw.isPolarModeConditional,}),
KeyboardShortcutUtilities.createForTool("y", AccuDrawSetLockYTool, {isHidden: FrameworkAccuDraw.isPolarModeConditional,}),
KeyboardShortcutUtilities.createForTool("z", AccuDrawSetLockZTool, {isHidden: FrameworkAccuDraw.isPolarModeConditional,}),
KeyboardShortcutUtilities.createForTool("a", AccuDrawSetLockAngleTool, {isHidden: FrameworkAccuDraw.isRectangularModeConditional,}),
KeyboardShortcutUtilities.createForTool("d", AccuDrawSetLockDistanceTool, {isHidden: FrameworkAccuDraw.isRectangularModeConditional,}),
  • The Z input field is necessary in 3d for Polar Mode too, it should not be shown only in Rectangular mode.
    The Front and Side standard rotations are only applicable to 3d as well (I could make AccuDraw.currentView public if that would help testing the condition?)

FrameworkToolAdmin should not check that focus is on Home in processShortcutKey. This prevents shortcuts from being used with viewport div overlays that can take focus but don't handle all KeyboardEvents. If the event is propagated to ToolAdmin and processShortcutKey is called it shouldn't care where focus is.

export class FrameworkToolAdmin extends ToolAdmin {
  public override async processShortcutKey(
    e: KeyboardEvent,
    wentDown: boolean
  ): Promise<boolean> {
    if (!wentDown) return false;
    if (UiFramework.isContextMenuOpen) return false;
    if (!UiFramework.keyboardShortcuts.isFocusOnHome) return false; // <- REMOVE?
    if (e.key === Key.Escape.valueOf()) return false;

    UiFramework.keyboardShortcuts.processKey(
      e.key,
      e.altKey,
      e.ctrlKey,
      e.shiftKey
    );
    return true;
  }
}

The popup menu for keyboard shortcuts is also preventing shortcuts from reliably being able to use the current AccuSnap as opening the menu both obscures the current cursor location and clears AccuSnap. Entering the shortcut really quickly does not clear AccuSnap which make for confusing and unreliable shortcut behavior.

The most important shortcut that will use the active snap location is "Set Origin", which will position the AccuDraw compass at the current snap location when snap, or the last data button location when the compass is not active and not snapped. Other shortcuts will use the snap when active to not require additional input from the user, such as “Rotate Axes”.

Image

What happens now is “RA” clears the current snap because of the menu appearing, so now when the shortcut runs it installs a tool and asks the user to identify the point to rotate to. If you press “RA” really fast you don’t lose the current snap so that can really mess with your expectations and be source of errors...

Image

Here’s what the popup looks like in MicroStation, you can see that it’s offset from the current point. You can still move the mouse into it to click an option w/o losing the snap too. I assume this is because motion isn’t being set to the view while the menu is up.

Image

To Reproduce

No response

Expected Behavior

No response

Screenshots

No response

Desktop (please complete the applicable information)

No response

Additional context

No response

@bbastings bbastings added the bug Something isn't working label Jan 21, 2025
@GerardasB GerardasB assigned GerardasB and unassigned GerardasB Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants