by robert » Fri Dec 14, 2012 5:04 am
I realize now that there's no way to install a single set of entries into an InputMap/ActionMap for all OS/keyboard layout combinations. This, combined with the fact that you cannot detect input method Locale changes at runtime in Java, means there's simply no easy, "simple" fix for this.
I started to hack together a solution that tried to detect your IM locale and OS, and did its best to install ToggleCommentAction and CloseMarkupTagAction appropriately so it would work on your system, but then decided that this was a bad idea. I'm going with the KISS principle here instead. CloseMarkupTagAction will be available everywhere (I believe in 2.0.4 and prior, it worked across all environments). ToggleCommentAction (which, in 2.0.4 and earlier, was "broken" on *nix, since those OSes would trigger both a KEY_TYPED '/' and a KEY_PRESSED ctrl+'/' when the user pressed ctrl+/, causing both a ToggleCommentAction and CloseMarkupTagAction to fire) will simply no longer be installed by default on *nix.
What this means in practical terms: Windows and OS X users will be able to type Ctrl+/ (or Cmd+/ on OS X) to toggle line comments on selected lines. On *nix, this shortcut will do nothing in 2.0.6. If an application using RSTA wants this action on Linux, they can easily assign a shortcut to it in the InputMap/ActionMap, but they're going to run into the problems outlined above.
Anybody interested, please try the
latest code in Subversion, or grab
this test jar, try it out, and report back and let me know how it works. I'd like to know:
- Your OS (feel free to test more than one!)
- Your keyboard layout (QWERTY, AZERTY, QWERTZ, something else?)
- Your input locale (which is likely your system locale)
I believe #3 is practically tied to #2, unless you go mucking with your input method locale in your system settings. Anyway, once it's verified that things are working as expected everywhere, I'll release 2.0.6 and we'll all be happy again.
- Windows, QWERTY: Working ('/' and ctrl+'/')
- Windows, QWERTZ:
- Windows, AZERTY:
- OS X, QWERTY: Working ('/' and ctrl+'/')
- OS X, QWERTZ:
- OS X, AZERTY:
- Linux, QWERTY:
- Linux, QWERTZ:
- Linux, AZERTY:
I realize now that there's no way to install a single set of entries into an InputMap/ActionMap for all OS/keyboard layout combinations. This, combined with the fact that you cannot detect input method Locale changes at runtime in Java, means there's simply no easy, "simple" fix for this.
I started to hack together a solution that tried to detect your IM locale and OS, and did its best to install ToggleCommentAction and CloseMarkupTagAction appropriately so it would work on your system, but then decided that this was a bad idea. I'm going with the KISS principle here instead. CloseMarkupTagAction will be available everywhere (I believe in 2.0.4 and prior, it worked across all environments). ToggleCommentAction (which, in 2.0.4 and earlier, was "broken" on *nix, since those OSes would trigger both a KEY_TYPED '/' and a KEY_PRESSED ctrl+'/' when the user pressed ctrl+/, causing both a ToggleCommentAction and CloseMarkupTagAction to fire) will simply no longer be installed by default on *nix.
What this means in practical terms: Windows and OS X users will be able to type Ctrl+/ (or Cmd+/ on OS X) to toggle line comments on selected lines. On *nix, this shortcut will do nothing in 2.0.6. If an application using RSTA wants this action on Linux, they can easily assign a shortcut to it in the InputMap/ActionMap, but they're going to run into the problems outlined above.
Anybody interested, please try the [url=http://svn.fifesoft.com/svn/RSyntaxTextArea/RSyntaxTextArea/]latest code in Subversion[/url], or grab [url=http://fifesoft.com/temp/rsyntaxtextarea.jar]this test jar[/url], try it out, and report back and let me know how it works. I'd like to know:
[list]
[*]Your OS (feel free to test more than one!)
[*]Your keyboard layout (QWERTY, AZERTY, QWERTZ, something else?)
[*]Your input locale (which is likely your system locale)[/list]
I believe #3 is practically tied to #2, unless you go mucking with your input method locale in your system settings. Anyway, once it's verified that things are working as expected everywhere, I'll release 2.0.6 and we'll all be happy again. 8-)
[list]
[*]Windows, QWERTY: [b][color=#008040]Working ('/' and ctrl+'/')[/color][/b]
[*]Windows, QWERTZ:
[*]Windows, AZERTY:
[*]OS X, QWERTY: [b][color=#008040]Working ('/' and ctrl+'/')[/color][/b]
[*]OS X, QWERTZ:
[*]OS X, AZERTY:
[*]Linux, QWERTY:
[*]Linux, QWERTZ:
[*]Linux, AZERTY: [/list]