237 *
238 * @param modifierFlags the NSEvent key modifiers
239 * @return the java key and mouse modifiers
240 */
241 static native int nsToJavaModifiers(int modifierFlags);
242
243 /*
244 * Converts NSEvent key info to AWT key info.
245 */
246 static native boolean nsToJavaKeyInfo(int[] in, int[] out);
247
248 /*
249 * Converts NSEvent key modifiers to AWT key info.
250 */
251 static native void nsKeyModifiersToJavaKeyInfo(int[] in, int[] out);
252
253 /*
254 * There is a small number of NS characters that need to be converted
255 * into other characters before we pass them to AWT.
256 */
257 static native char nsToJavaChar(char nsChar, int modifierFlags);
258
259 static boolean isPopupTrigger(int jmodifiers) {
260 final boolean isRightButtonDown = ((jmodifiers & InputEvent.BUTTON3_DOWN_MASK) != 0);
261 final boolean isLeftButtonDown = ((jmodifiers & InputEvent.BUTTON1_DOWN_MASK) != 0);
262 final boolean isControlDown = ((jmodifiers & InputEvent.CTRL_DOWN_MASK) != 0);
263 return isRightButtonDown || (isControlDown && isLeftButtonDown);
264 }
265 }
|
237 *
238 * @param modifierFlags the NSEvent key modifiers
239 * @return the java key and mouse modifiers
240 */
241 static native int nsToJavaModifiers(int modifierFlags);
242
243 /*
244 * Converts NSEvent key info to AWT key info.
245 */
246 static native boolean nsToJavaKeyInfo(int[] in, int[] out);
247
248 /*
249 * Converts NSEvent key modifiers to AWT key info.
250 */
251 static native void nsKeyModifiersToJavaKeyInfo(int[] in, int[] out);
252
253 /*
254 * There is a small number of NS characters that need to be converted
255 * into other characters before we pass them to AWT.
256 */
257 static native char nsToJavaChar(char nsChar, int modifierFlags, boolean spaceKeyTyped);
258
259 static boolean isPopupTrigger(int jmodifiers) {
260 final boolean isRightButtonDown = ((jmodifiers & InputEvent.BUTTON3_DOWN_MASK) != 0);
261 final boolean isLeftButtonDown = ((jmodifiers & InputEvent.BUTTON1_DOWN_MASK) != 0);
262 final boolean isControlDown = ((jmodifiers & InputEvent.CTRL_DOWN_MASK) != 0);
263 return isRightButtonDown || (isControlDown && isLeftButtonDown);
264 }
265 }
|