DevCharly commented on PR #5336:
URL: https://github.com/apache/netbeans/pull/5336#issuecomment-1429553540

   `KeyEvent.getKeyModifiersText()` and `InputEvent.getModifiersExText()` on 
macOS have the problem that the order of the modifier symbols is different to 
the order used by macOS (left is Java, right is macOS:
   
   
![Untitled](https://user-images.githubusercontent.com/5604048/218698550-06ea3af3-6671-4b7e-8881-0b6530ad0332.png)
 ![Untitled 
2](https://user-images.githubusercontent.com/5604048/218698517-47a6408e-d7bd-4263-9ace-1895230116bd.png)
 
   
   That's why FlatLaf and Aqua L&F use own methods.
   See: 
[FlatMenuItemRenderer.getMacOSModifiersExText()](https://github.com/JFormDesigner/FlatLaf/blob/546382e47170aa5b7132620b2cba32583d6011cc/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemRenderer.java#L621-L644)
 and 
[AquaMenuPainter.getKeyModifiersUnicode()](https://github.com/openjdk/jdk/blob/92474f13f03afacc48541b0de17998998f70eb65/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java#L91-L126)
   
   For right-to-left component orientation, Aqua L&F (and FlatLaf) reverses the 
order. E.g. Swing Aqua L&F:
   
   ![Untitled 
7](https://user-images.githubusercontent.com/5604048/218707775-d20e0cf2-bcbf-4d56-8b6d-adc677461607.png)
   
   BTW would suggest to replace deprecated `KeyEvent.getKeyModifiersText()` 
with `InputEvent.getModifiersExText()`.
   
   Tried this out. I see the change in the main toolbar, but not in editor/view 
toolbars and other areas. I fear that this kind of code is used in many places. 
It is also surprising that text "Ctrl" or "Shift" (instead of symbols) is used 
in some places on macOS.
   
   Editor toolbar:
   
   ![Untitled 
3](https://user-images.githubusercontent.com/5604048/218715607-4a27cd88-6cb3-4fb0-9b2d-fff95fd3fccb.png)
   
   Options Keymap:
   
   ![Untitled 
5](https://user-images.githubusercontent.com/5604048/218715717-efcf1dcd-e369-4c74-a03a-85f0eebc8f3e.png)
   
   Editor macro shortcut:
   
   ![Untitled 
6](https://user-images.githubusercontent.com/5604048/218715726-2591d501-d594-47d2-ac28-b03957ba8e99.png)
   
   Editor popup:
   
   ![Untitled 
4](https://user-images.githubusercontent.com/5604048/218716355-ac14b0de-9f70-4623-906f-1dd8958b1772.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to