marktext: Key binding does not work

已经将 user perference 下的aido设置为true了但是仍然不能用ctrl+/呼出界面

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (27 by maintainers)

Most upvoted comments

@learnyoung1990 @xxxgitone

I’m happy to announce that we solved the keybinding issue. Could you please check whether everything is ok on your machine. Maybe we have to improve the solution, particularly relating non US-keyboards. Prebuilt binaries for Linux and Windows are available here. Please see PR #543 for more information.

Thanks!

@Jocs Any updates here?

List of know broken shortcut on German keyboard - maybe all non-US keyboards.

Shortcut Working shortcut (Linux) Working shortcut (Windows)
Ctrl+U* Ctrl+Super+U not working
Ctrl+= Ctrl+Plus (+) Ctrl+Plus (+)
Ctrl+/ Ctrl+# (without Shift) Ctrl+# (without Shift)
Ctrl+Z Ctrl+Super+Z not working
Ctrl+Shift+Z not working not working

*: I think Ctrl+U (Ctrl+Shift+U) is a problem with unicode characters.

Dammit, I thought I was on Atom. Sorry for the noise 😆

@phaazon Do you mean you have an issue with atom or I don’t get you? If you have an issue related to atom or an atom extension please open an issue at atom. This issue tracks keyboard issues about Mark Text markdown editor. Otherwise can you please give me more details?

BTW AltGr+Space is often a operating system shortcut for non-breaking space.

I tested the issue with https://github.com/electron/electron-api-demos and key mapping is wrong too but all shortcuts work if you find the “right” keys. So a part of the issue is an electron problem.

Then I registered a global function and it works great for Ctrl+U but not for Ctrl+/ in Mark Text. If you test it with the menu item shortcut Ctrl+U, it does not work. In electron-api-demos is everything just fine. This means it’s a Mark Text problem. I have no idea any more…

But Ctrl + Z and Ctrl + / are work well with MacOs?

Maybe there is a difference between macOS and “PC” key handling in electron/codemirror. I know that you can prevent key events by setting flags in WIN32 API on Windows. So you can handle keys but other applications/events do not notice the key event.

@Jocs You help is appreciated.

Edit: It’s definitely a Mark Text render or editor problem because if you comment out as below, Ctrl+U works. Problem: Mark Text does not work any more because we do not load the “backend”. I would say that we prevent ctrl actions somewhere.

    win.once('ready-to-show', async () => {
      mainWindowState.manage(win)
      win.show()

    // removed some code

      const lineEnding = getOsLineEndingName()
      // win.webContents.send('AGANI::open-blank-window', {
      //   lineEnding,
      //   ignoreSaveStatus: true
      // })
      appMenu.updateLineEndingnMenu(lineEnding)
    })

We finally found the problem to some shortcut problems: https://github.com/marktext/marktext/issues/328#issuecomment-396633900. This affects all menu shortcuts which are also defined in the code above - like Ctrl+Z, Shift-Ctrl-Z and Ctrl+U.