question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"ESC" for closing cheat sheet is not working when there is "ESC" key specified for the app

See original GitHub issue

Configure hotkey module in a following way: HotkeyModule.forRoot({cheatSheetCloseEsc: true}) and cheat sheet can be closed with the “ESC” and the description is visible: image

When “ESC” key is being added via hotkeysService.add or directive (to work in the web app) cheat sheet “ESC” is not working anymore even though the description is still visible. I suppose the same thing will be with the “SHIFT + ?” combo.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
advorkinacommented, Jun 29, 2018

Hey, so I think I’ve found solution for this problem without any changes in the library. Basically inside of our wrapper service I’m calling this.hotkeysService.cheatSheetToggle.next(false) when esc event is triggered inside of the wrapper before passing it to the app.

  public hotkeyCallback(ev: KeyboardEvent, combo: string, commands: CommandDetail[]): boolean {
    if (this._isCheatSheetVisible && combo === this.escKey) {
      this.hotkeysService.cheatSheetToggle.next(false);
    }
    // ...call app callbacks

But don’t you think other people might have the same problem as me? Cause I don’t really see that as corner case cause ESC is a pretty used key. What is your plan with options and visible ESC description? Maybe I can help implementing that. Thanks for you help!

0reactions
wittlockcommented, Jul 7, 2018

I do agree that ESC is a commonly used key. But considering it’s disabled for closing the cheatsheet by default I also feel like it might not be too common to use it for both that and something else in your application. I might be wrong but I haven’t really got the impression there’s a huge demand for being able to bind one hotkey to multiple things.

Overall I’d like my best to keep complexity of the module down and adding multiple callbacks per hotkey feels like complexity that could be avoided and fairly easily worked around for the cases where it’s needed while maintaining the simplicity of the module.

And I think the solution you’ve found is quite good looking and a less complex approach than extending the module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Escape key not working on Mac
Learn how to troubleshoot your Mac keyboard and solve the Escape button not working issue effortlessly.
Read more >
ESC key is closing tool - MicroStation Forum
ESC key is closing tool · Go to Workspace > Preferences > Category: Input · Uncheck "Allow ESC key to stop current command"...
Read more >
Escape key not working | MacOS Monterrey 12.0.1
I am not able to use my Escape (Esc) key after upgrading to MacOS Monterrey 12.0.1. I am confident that it is not...
Read more >
How to prevent MFC dialog closing on Enter and Escape ...
When the user presses Enter key in a dialog two things can happen: The dialog has a default control (see CDialog::SetDefID() ).
Read more >
What to do if the Escape key is not working on Mac
But first, if you've been hitting escape to try closing an application, it might be the application that's stuck or hung in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found