Here you can find the source of keyStrokeModMac(String keyStrokeStr)
private static int keyStrokeModMac(String keyStrokeStr)
//package com.java2s; //License from project: Apache License import java.awt.*; import java.awt.event.*; public class Main { private static int keyStrokeModMac(String keyStrokeStr) { keyStrokeStr = keyStrokeStr.toLowerCase(); int mod = 0; if (keyStrokeStr.contains("ctrl") || keyStrokeStr.contains("control")) { mod = mod | InputEvent.CTRL_MASK; }/*w ww . j av a2 s . co m*/ if (keyStrokeStr.contains("alt")) { mod = mod | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); } if (keyStrokeStr.contains("meta")) { mod = mod | InputEvent.ALT_MASK; } return mod; } }