228 * Converts NSEvent mouse modifiers to AWT mouse modifiers. 229 */ 230 public static native int nsToJavaMouseModifiers(int buttonNumber, 231 int modifierFlags); 232 233 /* 234 * Converts NSEvent key modifiers to AWT key modifiers. 235 */ 236 public static native int nsToJavaKeyModifiers(int modifierFlags); 237 238 /* 239 * Converts NSEvent key info to AWT key info. 240 */ 241 public static native boolean nsToJavaKeyInfo(int[] in, int[] out); 242 243 /* 244 * Converts NSEvent key modifiers to AWT key info. 245 */ 246 public static native void nsKeyModifiersToJavaKeyInfo(int[] in, int[] out); 247 248 public static boolean isPopupTrigger(int jmodifiers) { 249 final boolean isRightButtonDown = ((jmodifiers & InputEvent.BUTTON3_DOWN_MASK) != 0); 250 final boolean isLeftButtonDown = ((jmodifiers & InputEvent.BUTTON1_DOWN_MASK) != 0); 251 final boolean isControlDown = ((jmodifiers & InputEvent.CTRL_DOWN_MASK) != 0); 252 return isRightButtonDown || (isControlDown && isLeftButtonDown); 253 } 254 } | 228 * Converts NSEvent mouse modifiers to AWT mouse modifiers. 229 */ 230 public static native int nsToJavaMouseModifiers(int buttonNumber, 231 int modifierFlags); 232 233 /* 234 * Converts NSEvent key modifiers to AWT key modifiers. 235 */ 236 public static native int nsToJavaKeyModifiers(int modifierFlags); 237 238 /* 239 * Converts NSEvent key info to AWT key info. 240 */ 241 public static native boolean nsToJavaKeyInfo(int[] in, int[] out); 242 243 /* 244 * Converts NSEvent key modifiers to AWT key info. 245 */ 246 public static native void nsKeyModifiersToJavaKeyInfo(int[] in, int[] out); 247 248 /* 249 * There is a small number of NS characters that need to be converted 250 * into other characters before we pass them to AWT. 251 */ 252 public static native char nsToJavaChar(char nsChar, int modifierFlags); 253 254 public static boolean isPopupTrigger(int jmodifiers) { 255 final boolean isRightButtonDown = ((jmodifiers & InputEvent.BUTTON3_DOWN_MASK) != 0); 256 final boolean isLeftButtonDown = ((jmodifiers & InputEvent.BUTTON1_DOWN_MASK) != 0); 257 final boolean isControlDown = ((jmodifiers & InputEvent.CTRL_DOWN_MASK) != 0); 258 return isRightButtonDown || (isControlDown && isLeftButtonDown); 259 } 260 } |