
arduino - issue #76
Menu-Keyboard Shortcuts Comment/Uncomment do not work on german keyboard
What steps will reproduce the problem? 1. Start Arduino on a machine set to Locale DE (Germany) with a german keyboard layout. 2. Select some text in a Sketch 3. Type Ctrl-/ to Comment the selected text
What is the expected output? Code in commented What do you see instead? All the selected Text is deleted and replaced by the character "7"
What version of the Arduino software are you using? 0017
On what operating system? Windows and Linux
Additional information.
None of the new shortcuts "Comment/Uncomment" "Increase/Decrease Indent" work .
On a german keyboard you reach the <slash>-char by typing Shift+7. Therefor the shortcut Crtl+"/" is unreachable on a german keyboard.
The same is true for the Ctrl+Bracket shortcuts used for indenting.
It's basically not a good idea to use any of the special chars in shortcuts because they tend to use all sorts of modifier keys on non-english-layout keyboards. Staying with [A-Z1-9] is about the only portable solution.
The plus '+' and minus '-' keys (with modifier Ctrl) would work on a german keyboard, but who knows, it might break the keyboard layout of some other language.
When you have changed the shortcuts for the above commands to something like Ctrl+G or Ctrl+8 you will either have to catch these combinations in method processing.app.EditorListener#keyTyped() or simply consume all KeyEvents in there, that have the KeyEvent.CTRL_MASK-modifier set.
This code here is pretty stupid (if and else run the same code) , but you get
the idea....
public boolean keyTyped(KeyEvent event) { char c = event.getKeyChar();
if ((event.getModifiers() & != 0) {
// on linux, ctrl-comma (prefs) being passed through to the editor
if (c == KeyEvent.VK_COMMA) {
event.consume();
return true;
}
else {
//we have to catch all other KeyEvents with a set CTRL_MASK too
//because otherwise the character that comes along with it
//will be forwarded to the textarea event handler.
event.consume();
return true;
}
}
return false;
}
Comment #1
Posted on Sep 13, 2011 by Helpful WombatThis is still an issue in the newest version of Arduino 1.0-beta4.
I'm on a danish keyboard and cannot use some of the shortcuts(Ctrl+Slash, Ctrl+Close bracket, Ctrl+Open bracket).
I believe other IDE's do not use these special characters. It should at least be configurable.
Comment #2
Posted on Sep 13, 2011 by Massive LionThere are other IDE's that use these special characters, for instance 'QtCreator' but they do it right: On a german keyboard you get the forward-slash with 'shift+7' Consequently QtCreator toggles one-line-comments on and off with 'ctrl+shift+7'.
Eberhard
Comment #3
Posted on Jun 27, 2012 by Helpful HorseComment deleted
Comment #4
Posted on Jun 27, 2012 by Helpful HorseI'm using a Mac with a German keyboard and Cmd+/ works but Cmd+[ or Cmd+] doesnt. It would be great if the Arduino team would fix that or make another way to implement these actions.
Comment #5
Posted on Jan 15, 2013 by Massive HippoCome on already! Please fix support for none english keyboards. To press / on a swedish keyboard one must use shift + 7. Ctrl + shift + 7 or ctrl + 7 doesn't comment the code.
Comment #6
Posted on Nov 13, 2013 by Massive HippoI thought that Arduino 1.5 BETA would include support for none English keyboards for the menu short Cuts like comment/uncomment but I thought wrong. Please fix this thanks.
Comment #7
Posted on Feb 11, 2014 by Quick KangarooComment deleted
Comment #8
Posted on Feb 11, 2014 by Quick KangarooComment deleted
Comment #9
Posted on Feb 11, 2014 by Quick KangarooHello I am form Germany and have, of course, the same annoying problem.
It woud be very nice if it could be fixed soon, since one can use this very often, not only leif from Sweden.
Greetings,
mcmusic
Comment #10
Posted on Oct 12, 2014 by Grumpy ElephantSame issue here with French-Canadian keyboard. Tried to change the shortcut with OSX preference system, and for some reason, these do not work either. Regards
Comment #11
Posted on May 27, 2015 by Quick Camelhttps://github.com/arduino/Arduino/issues/431#issuecomment-105852044
Status: Fixed
Labels:
Type-Defect
Priority-Medium