Pages: [1]   Go Down
Author Topic: Bug: Serial Monitor keyboard shortcut inserts CR  (Read 828 times)
0 Members and 1 Guest are viewing this topic.
wien
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Same as reported back in March of 2010 (Arduino v0018) here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1268106229

The shortcut key to activate the Serial Monitor is CTRL + SHIFT + M also inserts a CR. As an added bonus: if you have code selected, it will also be deleted smiley-roll-sweat. Either way your code is somewhat destroyed every time you use this combination of keys.

Yes, there is a beautiful icon in the upper-right but I always avoid using the mouse as much as possible when coding (old habits die hard), there's a reason hotkeys are also called accelerators smiley-wink

Suggestion for a quick and painless solution: Please change the hotkey! smiley

OS: Win7 64-bit.
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try the same thing in any Windows program. Its an "undocumented" feature of windose and not the fault of the IDE.
Logged

wien
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually it isn't specifically Windoze, CR translates to 0x0D (13 in decimal) which is sometimes translated as CTRL + M (13th char in the alphabet). My guess is that IDE is using built-in accelerator handling (e.g. Visual Studio) and therefore have no control over the situation. They could just add in special key-handling in 10-20 lines of code for this particular case.... or as already suggested: change the hotkey smiley-money

Either way, it's still the responsibility of the IDE to pick hotkeys that won't have unintended side-effects, that's why I labeled this as a bug. There is great potential here to destroy your code, if you have a block of text selected and press the hotkey. Personally I tend to leave my cursor somewhere in my code and that line of code is split into two, which is somewhat annoying, especially when you're a noob (like myself) and testing a lot.

They could also offer a method to change it, although that won't help people who don't dig around their IDE configuration, plus it would require quite a bit more work than both solutions offered above.
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Carriage Return (CR) = 0x0D = CHR(13) = CTRL+M. All are different ways of representing the same thing.
Logged

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It is already reported here: http://code.google.com/p/arduino/issues/detail?id=279

And I wrote a patch recently for it that's available here, hope it'll be included in the official version soon: https://github.com/arduino/Arduino/pull/64
Logged

Pages: [1]   Go Up
Jump to: