alyssaxuu / omni

The all-in-one tool to supercharge your productivity ⌨️

Home Page:https://chrome.google.com/webstore/detail/omni/mapjgeachilmcbbokkgcbgpbakaaeehi?hl=en&authuser=0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keybindings override

dadyarri opened this issue · comments

If current tab has actions on keyboard (like escape key in telegram web) it overrides action in Omni, and Omni does not closing

If current tab has actions on keyboard (like escape key in telegram web) it overrides action in Omni, and Omni does not closing

Bro, just click outside the menu
It will exit

Bro, just click outside the menu

I know, but there should be way to do it without mouse in that case

Bro, just click outside the menu

I know, but there should be way to do it without mouse in that case

type something that gives 0 results [like hhhhhhhhhhhhhhh] and press enter

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

making an close Omni command will do right?

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

making an close Omni command will do right?

Yes, closeOmni() makes the omnisearch close, the problem is how to make it trigger on the Esc key when Telegram seems to prevent it from propagating.

Wont making an action close Omni that will call closeOmni() be acceptable?

Or better, why not inject overide-hotkeys.js to the webpage while initiating omni ?

Wont making an action close Omni that will call closeOmni() be acceptable?

No, there are many ways to close Omni already (clicking outside the omnisearch, pressing Esc, and pressing on the extension icon), and they all should work.

Or better, why not inject overide-hotkeys.js to the webpage while initiating omni ?

This wouldn't solve anything, the keypress event would still not propagate.

overide-hotkeys.js

onkeydown = function(e){
  if(e.escKey.charCodeAt(0)){
    e.preventDefault();
  }
}

ig this would work

onkeydown = function(e){
  if(e.escKey.charCodeAt(0)){
    e.preventDefault();
  }
}

Doesn't quite work, I ended up doing a different thing though and managed to fix it. A bit weird but basically listening for the keyup event outside jQuery did work, so I used that and then closed it through there.

ezoic increase your site revenue