sdedic commented on code in PR #6434:
URL: https://github.com/apache/netbeans/pull/6434#discussion_r1334333827
##########
platform/core.windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java:
##########
@@ -297,6 +311,71 @@ private boolean processShortcut(KeyEvent ev) {
return false;
}
+ private void processMouseEvent(MouseEvent mev) {
+ if (mev.getID() != MouseEvent.MOUSE_PRESSED
+ || mev.getButton() <= MouseEvent.BUTTON3
+ || mev.getButton() > 10
Review Comment:
Add a constant for max supported buttons to API, document.
##########
platform/openide.util.ui/src/org/openide/util/Utilities.java:
##########
@@ -790,6 +790,13 @@ private static synchronized NamesAndValues
initNameAndValues() {
values.put(0x290,"MOUSE_WHEEL_UP");
values.put(0x291,"MOUSE_WHEEL_DOWN");
+ for (int button = 4; button < 10; button++) {
+ String name = "MOUSE_BUTTON" + button; // NOI18N
+ int code = 0x292 + (button - 1);
+ names.put(name, code);
Review Comment:
Maybe for future compatibility (similar to CONTEXT_MENU): check if the name
is not defined (yet).
##########
platform/openide.util.ui/src/org/openide/util/Utilities.java:
##########
@@ -790,6 +790,13 @@ private static synchronized NamesAndValues
initNameAndValues() {
values.put(0x290,"MOUSE_WHEEL_UP");
values.put(0x291,"MOUSE_WHEEL_DOWN");
+ for (int button = 4; button < 10; button++) {
Review Comment:
I'd suggest to make constants for these pseudo-codes, or maybe better
functions: like `mouseButtonToKeyCode(int mouseButton)` with `-1` result out of
the supported range; and the opposite `keyCodeToMouseButton(int keyCode)`.
The magic constant `0x292` is used in 3 modules.
--
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