Problem with the ctrl + ` (grave accent) shortcut on german keyboards >_<

hey,
I was rly happy to see that code formatting finally got his own shortcut through the last updates, because I use codeblocks a lot. But unfortunately german keyboards have a special way to type the grave accent `. It’s a so called dead key, what means he doesn’t get visible before another letter like e.g. space or e (è) is getting typed. I mostly got around that by writing codeblocks with hitting shift + ´ and then hitting the space key to make the grave accent visible or by hitting shift + ´ several times (it just needs a little more time). After some time i found out, there is also the possibiliy to choose a german keyboard layout with “no dead keys”, at least under Linux, what kinda solved the whole problem. But with the new shortcut there is a problem, because using ctrl + shift + ´ doesn’t work, the ` (grave accent) won’t be activated over shift + ´, so there is currently no easy way to make this shortcut work for german keyboards, even though it’s so extremely usefull. I don’t mean changing the syntax of how codeblocks get written, what would mean to change Mardkown and what can easily by worked around by changing the keyboard layout, but i mean to make the shortcut which makes a selection automatically get this `selection` grave accent around it changable, because that shortcut is incredibly timesaving, as else one has to go to the beginning and end of the codeblock and add this ` grave accents there manually. Thus, it would be rly great if Joplin would offer a option to edit hotkeys in the future, so that user with german keyboards are also able to use this rly usefull shortcut >_<

Hmm, yes that’s true, we need to change this as also French keyboards can’t use this shortcut.

I see StackOverflow uses Ctrl+K but for us it’s already used for links. Any suggestion on what would make a good shortcut?

When I picked the shortcut, I did so, because ` made sense and because I’ve seen a Meta + ` shortcut in many other programs as well. It’s also very convenient and easy type on an English keyboard. I never thought that it might not work on a different layout.
Are you telling me that this shortcut only works on an English keyboard? This means that all programs that use such a shortcut only “partially” work on non-English keyboards, which seems very strange to me.

But I certainly agree that in that case we have to make sure it works on all keyboards.

In macOS there’s a way to change shortcuts for applications. But I do not know, if this is possible in Linux and Windows. Anyhow, I thought about another shortcut, but I haven’t been able to come up with one.

P.S.: Is it possible to assign a second shortcut for an action in Electron? I’d hate to lose the current shortcut because on an English keyboard it is really highly convenient and easy to type.

1 Like

The thing is, making it ctrl + ` is just the perfect choice, as codeblocks are also written using these grave accents as tessus also remarked and it would destroy a lot…

Another kind of fitting choice would be to take ctrl + <, as <> also resemble some kind of block in some languages, but that’s a pretty unclean solution and not a very elegant way…
The best solution i could come up with was to maybe allow both ctrl + ` and ctrl + ´ to put a selection into grave accents, because on the german keyboard ´ can be reached without having to use shift.

Another possibility would be to make shift being recognized to be hit together with ctrl and ´ to trigger this action, but I also don’t know if the last two ideas work in Electron x.x

I also remember coming across similiar problems in other programs, but mostly it just worked out to use shift together with ctrl to access keys that are only accessible over shift.

But i also remember programs like IDLE, this Python IDE shipped together with Python, where I just couldn’t use a shortcut. But in IDLE i could change the shortcut over a menu.

I just tried it out on Windows and on another Linux OS on my Laptop and the shortcut didn’t work out, but maybe I’m just missing out a way such keys can alternatively be accessed on geman keyboards >_<

This sounds like a good idea. I hope it is possible to use 2 shortcuts. @laurent do you know if this can be done? Or is it possible for Electron to determine the keybord layout?

Come to think of it, now I’m starting to wonder how people with Korean (or Arabic, Japanese, …) layouts are using shortcuts at all.

I meant that the macOS system itself (System Preferences -> Keyboard -> Shortcuts -> App Shortcuts) allows you to redefine shortcuts for applications.

:joy: I just sat next to a china man in the library, I should've asked him...
It's quite interesting with what kind of topics software developers have to deal with in their daily routine. They get to know a lot of random knowledge about different cultures and countries xD

oh sry, I first wanted to make that point and then forgot answering the actual question x.x
As I know there's no way directly given by any Linux distro to set shortcuts for applications without installing additional programs, not even in Linux Mint, which is probably the most user friendly Linux distro out there.
It's only possible to set custom shortcuts to e.g. launch applications with certain arguments. But that's only what I know so far >_<

They have qwerty keyboards in China. I guess this is the most common layout and we're just being annoying with our azerty and qwertz layouts in Europe :smile:

Using 2 shortcuts for an action is possible in Electron so i guess that's what we should do. Ideally it should be possible to customise the shortcuts but we aren't there yet.

I just checked. Apparently this only works for Windows and Linux. That is with the version of Electron we are using. Only version 6 supports this on macOS. However, on macOS people can still use the workaround I described above.
Anyway, I’ll create a PR in a bit…

I don’t think we need built-in support for this from the OS or Electron. Currently Ctrl+` maps to an action, so we just add a new shortcut, Ctrl+Something that maps to the same action.

Well, that’s the thing. I could only find a way to do that by creating a second invisible menu item. And this won’t trigger on macOS before Electron 6. But as mentioned before, on mcOS it’s not necessary anyway, because there’s a workaround.

However, someone has to test this, because I don’t have Windows or Linux with a DE.

um, I guess as I’m the questioner and only person so highly interested in getting this shortcut working, I kinda have the obligation to test it xD
I assume I have to make my way to GitHub, download the newest upload and build it somehow to test it, right? Unfortunately, I have no idea how all this Makefile, building stuff works, but I could give it a try as I’m anyways planning to learn Git soon >_<

Nope, Laurent didn’t merge the PR. So there’s no fix. I’m sorry.

and a little addition for other dudes with German Keyboard and Linux:
It’s possible to change the Keyboard layout to “German (no dead keys)” which makes typing this grave accent way more handy as u don’t have to type ` and space all time. Under Linux Mint u can find it under “System Settings”/Keyboard/Layouts.

oh sry, I kinda fly over the posts and missread it >_<
I rly have to go to bed, almost 2am in germany xD

gn u_u (zzz)