Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts not working properly with international keyboards #1693

Closed
pierredewilde opened this issue Aug 9, 2017 · 10 comments
Closed

Shortcuts not working properly with international keyboards #1693

pierredewilde opened this issue Aug 9, 2017 · 10 comments

Comments

@pierredewilde
Copy link
Contributor

The idea to have Consistency across Platforms shortcuts is appealing but the current implementation (v3.0) does not work properly with international keyboards (eg issue #1601).

For instance, on a MacBookAir with AZERTY Belgian keyboard (S=Shift C=Ctrl A=Alt M=Cmd):

M-{ - Switch buffer to the left => A-M-(
M-} - Switch buffer to the right => A-M-)
M-+ - Increase text size of current buffer => S-M-=

M-] - Copy selection to paste buffer => S-A-M-) :-)
C-] - Cut selection to paste buffer => S-A-C-)

M-/ - Comment/Uncomment current line or selection => S-M-:

M-< - Move to beginning of buffer => M-< (not working)
M-> - Move to end of buffer => S+M+<

None of those shortcuts works properly, which is very annoying since there is no way to change the keyboard mapping.

Thanks,
Pierre

@samaaron
Copy link
Collaborator

Understood - happy to consider pull requests. However we don't currently have the resources to support all keyboard layouts at this time. Apologies.

@pierredewilde
Copy link
Contributor Author

Thank for your support.

Supporting all keyboard layouts one by one is indeed out of scope.

The idea is to be dependent on Meta and Ctrl key modifiers (eg M-\) but independent on Shift and Alt key modifiers required to generate special characters (eg \ { } [ ] < >) on international keyboards.

@samaaron
Copy link
Collaborator

That certainly sounds more manageable. Could you flesh this idea out a little more?

@pierredewilde
Copy link
Contributor Author

Most keys are safe: A-Z F1-10 Esc Tab Backspace Left Right Up Down with all modifiers Shift Ctrl Meta are compatible with most keyboards.

Some keys have minor issues: F11-12 Home End are not always available but alternatives exist.

Some keys have major issues: <>\/{}[]. Those keys are located differently on international keyboards.

For example, M-< is currently implemented in sonicpiscintilla.cpp with:

addKeyBinding(settings, QsciCommand::DocumentStart, Qt::Key_Comma | Qt::SHIFT | SPi_META);

Meta-Shift-, is converted into Meta-< but works only with UK/US keyboards (hard-coded).

Another example is M-/ to comment code implemented in mainwindow.cpp with:

QShortcut *toggleLineComment= new QShortcut(metaKey('/'), workspace);
connect(toggleLineComment, SIGNAL(activated()), this, SLOT(toggleCommentInCurrentWorkspace()));

In most non-US/UK keyboards, / is only accessible with the Shift modifier.

Final example is M-{ and M-} also implemented in mainwindow.cpp with:

new QShortcut(shiftMetaKey('['), this, SLOT(tabPrev()));
new QShortcut(shiftMetaKey(']'), this, SLOT(tabNext()));

Shift-[ is assumed to be converted to { and Shift-] to }. Unfortunately, this is not the case in most international keyboards. Alt-( is used for { and Shift-Alt-( for [.

A possible workaround is to add alternative key combinations but it is still keyboard-dependent.
Another workaround is to avoid the use of those special characters and stay stuck with safe keys.

HTH,
Pierre

@guardabrazo
Copy link

This would be so nice to have!
I work with a Spanish-ISO keyboard layout and I'm able to use the Atom or Xcode commenting/uncommenting shortcut with M-Shift-/

@quintendewilde
Copy link

Is there any workaround because it's very annoying that I can not comment out certain parts quick when trying in out code in a live setup?

@adam-suki
Copy link
Contributor

Would it be okay then to duplicate the shortcut options for the keys in question and add alternatives to these shortcuts with some available combinations based on @pierredewilde 's suggestion?

@samaaron
Copy link
Collaborator

Unfortunately the shortcuts are all hard-coded into the GUI and are not currently dynamic and rebindable.

General discussion about this is taking place here: #3162

@d3cod3
Copy link

d3cod3 commented Nov 3, 2023

Understood - happy to consider pull requests. However we don't currently have the resources to support all keyboard layouts at this time. Apologies.

#3341

@quintendewilde
Copy link

quintendewilde commented Nov 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants