// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_ALT = 0x0001;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_CONTROL = 0x0002;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_NOREPEAT = 0x4000;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_SHIFT = 0x0004;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_WIN = 0x0008;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_NEXT_TRACK = 0xB0;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_PLAY_PAUSE = 0xB3;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_PREV_TRACK = 0xB1;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_STOP = 0xB2;
// 
// Path: jkeymaster/com/tulskiy/keymaster/common/HotKey.java
// public class HotKey {
//     private KeyStroke keyStroke;
//     private MediaKey mediaKey;
//     private HotKeyListener listener;
// 
//     public HotKey(KeyStroke keyStroke, HotKeyListener listener) {
//         this.keyStroke = keyStroke;
//         this.listener = listener;
//     }
// 
//     public HotKey(MediaKey mediaKey, HotKeyListener listener) {
//         this.mediaKey = mediaKey;
//         this.listener = listener;
//     }
// 
//     public boolean isMedia() {
//         return mediaKey != null;
//     }
//     
//     public KeyStroke getKeyStroke() {
// 		return keyStroke;
// 	}
// 
// 	public void setKeyStroke(KeyStroke keyStroke) {
// 		this.keyStroke = keyStroke;
// 	}
// 
// 	public MediaKey getMediaKey() {
// 		return mediaKey;
// 	}
// 
// 	public void setMediaKey(MediaKey mediaKey) {
// 		this.mediaKey = mediaKey;
// 	}
// 
// 	public HotKeyListener getListener() {
// 		return listener;
// 	}
// 
// 	public void setListener(HotKeyListener listener) {
//     	this.listener = listener;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder();
//         sb.append("HotKey");
//         if (keyStroke != null)
//             sb.append("{").append(keyStroke.toString().replaceAll("pressed ", ""));
//         if (mediaKey != null)
//             sb.append("{").append(mediaKey);
//         sb.append('}');
//         return sb.toString();
//     }
// }


import static com.tulskiy.keymaster.windows.User32.MOD_ALT;
import static com.tulskiy.keymaster.windows.User32.MOD_CONTROL;
import static com.tulskiy.keymaster.windows.User32.MOD_NOREPEAT;
import static com.tulskiy.keymaster.windows.User32.MOD_SHIFT;
import static com.tulskiy.keymaster.windows.User32.MOD_WIN;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_NEXT_TRACK;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_PLAY_PAUSE;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_PREV_TRACK;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_STOP;
import static java.awt.event.KeyEvent.VK_COMMA;
import static java.awt.event.KeyEvent.VK_DELETE;
import static java.awt.event.KeyEvent.VK_ENTER;
import static java.awt.event.KeyEvent.VK_INSERT;
import static java.awt.event.KeyEvent.VK_MINUS;
import static java.awt.event.KeyEvent.VK_PERIOD;
import static java.awt.event.KeyEvent.VK_PLUS;
import static java.awt.event.KeyEvent.VK_PRINTSCREEN;
import static java.awt.event.KeyEvent.VK_SEMICOLON;
import static java.awt.event.KeyEvent.VK_SLASH;
import java.awt.event.InputEvent;
import java.util.HashMap;
import java.util.Map;
import javax.swing.KeyStroke;
import com.tulskiy.keymaster.common.HotKey;

            return code;
        } else {
            KeyStroke keyStroke = hotKey.getKeyStroke();
            Integer code = codeExceptions.get(keyStroke.getKeyCode());
            if (code != null) {
                return code;
            } else
                return keyStroke.getKeyCode();
        }
    }

    public static int getModifiers(KeyStroke keyCode) {
        int modifiers = 0;
        if (keyCode != null) {
            if ((keyCode.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0) {
                modifiers |= MOD_SHIFT;
            }
            if ((keyCode.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0) {
                modifiers |= MOD_CONTROL;
            }
            if ((keyCode.getModifiers() & InputEvent.META_DOWN_MASK) != 0) {
                modifiers |= MOD_WIN;
            }
            if ((keyCode.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0) {
                modifiers |= MOD_ALT;
            }
        }

        if (System.getProperty("os.name", "").startsWith("Windows 7")) {
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_ALT = 0x0001;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_CONTROL = 0x0002;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_NOREPEAT = 0x4000;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_SHIFT = 0x0004;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int MOD_WIN = 0x0008;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_NEXT_TRACK = 0xB0;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_PLAY_PAUSE = 0xB3;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_PREV_TRACK = 0xB1;
// 
// Path: jkeymaster/com/tulskiy/keymaster/windows/User32.java
// public static final int VK_MEDIA_STOP = 0xB2;
// 
// Path: jkeymaster/com/tulskiy/keymaster/common/HotKey.java
// public class HotKey {
//     private KeyStroke keyStroke;
//     private MediaKey mediaKey;
//     private HotKeyListener listener;
// 
//     public HotKey(KeyStroke keyStroke, HotKeyListener listener) {
//         this.keyStroke = keyStroke;
//         this.listener = listener;
//     }
// 
//     public HotKey(MediaKey mediaKey, HotKeyListener listener) {
//         this.mediaKey = mediaKey;
//         this.listener = listener;
//     }
// 
//     public boolean isMedia() {
//         return mediaKey != null;
//     }
//     
//     public KeyStroke getKeyStroke() {
// 		return keyStroke;
// 	}
// 
// 	public void setKeyStroke(KeyStroke keyStroke) {
// 		this.keyStroke = keyStroke;
// 	}
// 
// 	public MediaKey getMediaKey() {
// 		return mediaKey;
// 	}
// 
// 	public void setMediaKey(MediaKey mediaKey) {
// 		this.mediaKey = mediaKey;
// 	}
// 
// 	public HotKeyListener getListener() {
// 		return listener;
// 	}
// 
// 	public void setListener(HotKeyListener listener) {
//     	this.listener = listener;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder();
//         sb.append("HotKey");
//         if (keyStroke != null)
//             sb.append("{").append(keyStroke.toString().replaceAll("pressed ", ""));
//         if (mediaKey != null)
//             sb.append("{").append(mediaKey);
//         sb.append('}');
//         return sb.toString();
//     }
// }


// Path: jkeymaster/com/tulskiy/keymaster/windows/KeyMap.java
import static com.tulskiy.keymaster.windows.User32.MOD_ALT;
import static com.tulskiy.keymaster.windows.User32.MOD_CONTROL;
import static com.tulskiy.keymaster.windows.User32.MOD_NOREPEAT;
import static com.tulskiy.keymaster.windows.User32.MOD_SHIFT;
import static com.tulskiy.keymaster.windows.User32.MOD_WIN;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_NEXT_TRACK;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_PLAY_PAUSE;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_PREV_TRACK;
import static com.tulskiy.keymaster.windows.User32.VK_MEDIA_STOP;
import static java.awt.event.KeyEvent.VK_COMMA;
import static java.awt.event.KeyEvent.VK_DELETE;
import static java.awt.event.KeyEvent.VK_ENTER;
import static java.awt.event.KeyEvent.VK_INSERT;
import static java.awt.event.KeyEvent.VK_MINUS;
import static java.awt.event.KeyEvent.VK_PERIOD;
import static java.awt.event.KeyEvent.VK_PLUS;
import static java.awt.event.KeyEvent.VK_PRINTSCREEN;
import static java.awt.event.KeyEvent.VK_SEMICOLON;
import static java.awt.event.KeyEvent.VK_SLASH;
import java.awt.event.InputEvent;
import java.util.HashMap;
import java.util.Map;
import javax.swing.KeyStroke;
import com.tulskiy.keymaster.common.HotKey;


            return code;
        } else {
            KeyStroke keyStroke = hotKey.getKeyStroke();
            Integer code = codeExceptions.get(keyStroke.getKeyCode());
            if (code != null) {
                return code;
            } else
                return keyStroke.getKeyCode();
        }
    }

    public static int getModifiers(KeyStroke keyCode) {
        int modifiers = 0;
        if (keyCode != null) {
            if ((keyCode.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0) {
                modifiers |= MOD_SHIFT;
            }
            if ((keyCode.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0) {
                modifiers |= MOD_CONTROL;
            }
            if ((keyCode.getModifiers() & InputEvent.META_DOWN_MASK) != 0) {
                modifiers |= MOD_WIN;
            }
            if ((keyCode.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0) {
                modifiers |= MOD_ALT;
            }
        }

        if (System.getProperty("os.name", "").startsWith("Windows 7")) {
            modifiers |= MOD_NOREPEAT;