jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Menu-Keyboard Shortcuts Comment/Uncomment do not work on german keyboard #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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;
  }

Original issue reported on code.google.com by e.fa...@wayoda.org on 12 Aug 2009 at 8:09

GoogleCodeExporter commented 9 years ago
This 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.

Original comment by nbjen...@gmail.com on 13 Sep 2011 at 7:39

GoogleCodeExporter commented 9 years ago
There 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

Original comment by e.fa...@wayoda.org on 13 Sep 2011 at 10:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'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.

Original comment by bolli.al...@googlemail.com on 27 Jun 2012 at 4:08

GoogleCodeExporter commented 9 years ago
Come 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.

Original comment by leif.nor...@gmail.com on 15 Jan 2013 at 7:54

GoogleCodeExporter commented 9 years ago
I 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.

Original comment by leif.nor...@gmail.com on 13 Nov 2013 at 2:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello
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

Original comment by ulrich...@googlemail.com on 11 Feb 2014 at 5:08

GoogleCodeExporter commented 9 years ago
Same 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

Original comment by musi...@gmail.com on 12 Oct 2014 at 3:57

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/issues/431#issuecomment-105852044

Original comment by federico...@gmail.com on 27 May 2015 at 10:08