Code Monkey home page Code Monkey logo

Comments (10)

posobin avatar posobin commented on September 18, 2024

You mean when letting go of Alt the popups still stay? Maybe because the menu that appears steals the keyboard focus and the keyup event for Alt is not fired. Could you check if the blur event for a document is fired after pressing alt? I guess I might have to offer a choice between {Alt, Ctrl}+(Shift)?, would holding down Ctrl be problematic? What about Meta?

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

You mean when letting go of Alt the popups still stay?

Yep! I think the more annoying thing however is that it toggles the menu, which shifts the whole page down, so might discourage people from using it.

Tried this:

document.addEventListener('blur' , () => console.error("BLUR"));
document.addEventListener('focus', () => console.error("FOCUS"));

However pressing Alt doesn't trigger either of these. I'd imagine it's more of OS-level stuff.. I'd be surprised if you'd manage to bind Shift; Meta might work, but it also might conflict with the global menu key for some people. It's sad it's so complicated, but adding some sort of setting for this might be the best option :(

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

Also, just realized, I have some other Alt bindings (e.g. Alt+j/k), and they work fine without causing the menu to toggle. In fact, I can press any non-existing Alt binding (e.g. Alt-F), and it causes Ampie to pop up without showing the window menu!

from ampie.

posobin avatar posobin commented on September 18, 2024

I added the ability to switch to meta/ctrl/shift or disable it completely in the settings (you need to click the ampie icon in the extensions toolbar to open it). Does it work for you?

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

Uhoh, it's not loading, just all white (was working before!) :(
image

Oddly, I can't run devtools against it, but in the background page there are a bunch of warnings, perhaps they are relevant

09:22:40.125 The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. popup.html
09:22:40.149
sendRemoveListener on closed conduit {4ca7b2f4-ff6f-4599-a39b-9f776f3e8ba6}.1374390572883 ConduitsChild.jsm:108
09:22:40.150
Promise resolved after context unloaded
popup-page.js:1545
09:22:40.151
Promise resolved after context unloaded
popup-page.js:1418
09:23:23.005
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. background.js:1

from ampie.

posobin avatar posobin commented on September 18, 2024

Very weird, does this stay after you restart the browser? The messages look like the extension was unloaded after the popup page was opened, or the popup is running a different version of the source somehow.

from ampie.

posobin avatar posobin commented on September 18, 2024

I took my old linux laptop out and can't reproduce this on firefox.

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

Huh, indeed, after restart it works fine, thanks!
Yeah, I also remember now I had some issues with my extension after update unless I restarted. I think there is some extension lifecycle method one can listen on, but don't remember exactly.

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

Hmm interesting, happened again after I briefly turned extension off and then back on. I'll see if I can consistently reproduce.

from ampie.

karlicoss avatar karlicoss commented on September 18, 2024

P.S. oh sorry, and back to the original issue -- the hotkey selection works, thanks! I'll try Shift in the meantime, hopefully it won't conflict with anything.

from ampie.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.