public static final int XF86XK_AudioNext = 0x1008FF17;  /* Next track                 */ public static final int XF86XK_AudioPlay = 0x1008FF14;  /* Start playing of audio >   */ public static final int XF86XK_AudioPrev = 0x1008FF16;  /* Previous track             */ public static final int XF86XK_AudioStop = 0x1008FF15;  /* Stop playing audio         */ public static final int XK_BackSpace = 0xff08;  /* Back space, back char */ public static final int XK_Begin = 0xff58;  /* BOL */ public static final int XK_Clear = 0xff0b; public static final int XK_Delete = 0xffff;  /* Delete, rubout */ public static final int XK_Down = 0xff54;  /* Move down, down arrow */ public static final int XK_End = 0xff57;  /* EOL */ public static final int XK_Escape = 0xff1b; public static final int XK_F1 = 0xffbe; public static final int XK_Home = 0xff50; public static final int XK_Insert = 0xff63;  /* Insert, insert here */ public static final int XK_KP_0 = 0xffb0; public static final int XK_KP_Add = 0xffab; public static final int XK_KP_Begin = 0xff9d; public static final int XK_KP_Divide = 0xffaf; public static final int XK_KP_Down = 0xff99; public static final int XK_KP_Left = 0xff96; public static final int XK_KP_Multiply = 0xffaa; public static final int XK_KP_Right = 0xff98; public static final int XK_KP_Subtract = 0xffad; public static final int XK_KP_Up = 0xff97; public static final int XK_Left = 0xff51;  /* Move left, left arrow */ public static final int XK_Page_Down = 0xff56; public static final int XK_Page_Up = 0xff55; public static final int XK_Pause = 0xff13;  /* Pause, hold */ public static final int XK_PrintScreen = 0xff61; /* Print screen */ public static final int XK_Return = 0xff0d;  /* Return, enter */ public static final int XK_Right = 0xff53;  /* Move right, right arrow */ public static final int XK_Scroll_Lock = 0xff14; public static final int XK_Tab = 0xff09; public static final int XK_Up = 0xff52;  /* Move up, up arrow */ public static final int XK_ampersand = 0x0026;  /* U+0026 AMPERSAND */ public static final int XK_asciicircum = 0x005e;  /* U+005E CIRCUMFLEX ACCENT */ public static final int XK_asterisk = 0x002a;  /* U+002A ASTERISK */ public static final int XK_at = 0x0040;  /* U+0040 COMMERCIAL AT */ public static final int XK_backslash = 0x005c;  /* U+005C REVERSE SOLIDUS */ public static final int XK_braceleft = 0x007b;  /* U+007B LEFT CURLY BRACKET */ public static final int XK_braceright = 0x007d;  /* U+007D RIGHT CURLY BRACKET */ public static final int XK_colon = 0x003a;  /* U+003A COLON */ public static final int XK_comma = 0x002c;  /* U+002C COMMA */ public static final int XK_dollar = 0x0024;  /* U+0024 DOLLAR SIGN */ public static final int XK_equal = 0x003d;  /* U+003D EQUALS SIGN */ public static final int XK_exclam = 0x0021;  /* U+0021 EXCLAMATION MARK */ public static final int XK_grave = 0x0060;  /* U+0060 GRAVE ACCENT */ public static final int XK_greater = 0x003e;  /* U+003E GREATER-THAN SIGN */ public static final int XK_less = 0x003c;  /* U+003C LESS-THAN SIGN */ public static final int XK_minus = 0x002d;  /* U+002D HYPHEN-MINUS */ public static final int XK_numbersign = 0x0023;  /* U+0023 NUMBER SIGN */ public static final int XK_parenleft = 0x0028;  /* U+0028 LEFT PARENTHESIS */ public static final int XK_parenright = 0x0029;  /* U+0029 RIGHT PARENTHESIS */ public static final int XK_period = 0x002e;  /* U+002E FULL STOP */ public static final int XK_plus = 0x002b;  /* U+002B PLUS SIGN */ public static final int XK_quotedbl = 0x0022;  /* U+0022 QUOTATION MARK */ public static final int XK_semicolon = 0x003b;  /* U+003B SEMICOLON */ public static final int XK_slash = 0x002f;  /* U+002F SOLIDUS */ public static final int XK_space = 0x0020;  /* U+0020 SPACE */ public static final int XK_underscore = 0x005f;  /* U+005F LOW LINE */
import static com.tulskiy.keymaster.x11.KeySymDef.XF86XK_AudioNext;
import static com.tulskiy.keymaster.x11.KeySymDef.XF86XK_AudioPlay;
import static com.tulskiy.keymaster.x11.KeySymDef.XF86XK_AudioPrev;
import static com.tulskiy.keymaster.x11.KeySymDef.XF86XK_AudioStop;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_BackSpace;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Begin;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Clear;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Delete;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Down;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_End;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Escape;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_F1;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Home;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Insert;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_0;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Add;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Begin;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Divide;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Down;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Left;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Multiply;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Right;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Subtract;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_KP_Up;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Left;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Page_Down;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Page_Up;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Pause;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_PrintScreen;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Return;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Right;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Scroll_Lock;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Tab;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_Up;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_ampersand;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_asciicircum;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_asterisk;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_at;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_backslash;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_braceleft;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_braceright;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_colon;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_comma;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_dollar;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_equal;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_exclam;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_grave;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_greater;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_less;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_minus;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_numbersign;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_parenleft;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_parenright;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_period;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_plus;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_quotedbl;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_semicolon;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_slash;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_space;
import static com.tulskiy.keymaster.x11.KeySymDef.XK_underscore;
import static com.tulskiy.keymaster.x11.X11.ControlMask;
import static com.tulskiy.keymaster.x11.X11.Lib;
import static com.tulskiy.keymaster.x11.X11.Mod1Mask;
import static com.tulskiy.keymaster.x11.X11.Mod4Mask;
import static com.tulskiy.keymaster.x11.X11.ShiftMask;
import static java.awt.event.KeyEvent.VK_0;
import static java.awt.event.KeyEvent.VK_9;
import static java.awt.event.KeyEvent.VK_A;
import static java.awt.event.KeyEvent.VK_ADD;
import static java.awt.event.KeyEvent.VK_AMPERSAND;
import static java.awt.event.KeyEvent.VK_ASTERISK;
import static java.awt.event.KeyEvent.VK_AT;
import static java.awt.event.KeyEvent.VK_BACK_QUOTE;
import static java.awt.event.KeyEvent.VK_BACK_SLASH;
import static java.awt.event.KeyEvent.VK_BACK_SPACE;
import static java.awt.event.KeyEvent.VK_BEGIN;
import static java.awt.event.KeyEvent.VK_BRACELEFT;
import static java.awt.event.KeyEvent.VK_BRACERIGHT;
import static java.awt.event.KeyEvent.VK_CIRCUMFLEX;
import static java.awt.event.KeyEvent.VK_CLEAR;
import static java.awt.event.KeyEvent.VK_COLON;
import static java.awt.event.KeyEvent.VK_COMMA;
import static java.awt.event.KeyEvent.VK_DELETE;
import static java.awt.event.KeyEvent.VK_DIVIDE;
import static java.awt.event.KeyEvent.VK_DOLLAR;
import static java.awt.event.KeyEvent.VK_DOWN;
import static java.awt.event.KeyEvent.VK_END;
import static java.awt.event.KeyEvent.VK_ENTER;
import static java.awt.event.KeyEvent.VK_EQUALS;
import static java.awt.event.KeyEvent.VK_ESCAPE;
import static java.awt.event.KeyEvent.VK_EXCLAMATION_MARK;
import static java.awt.event.KeyEvent.VK_F1;
import static java.awt.event.KeyEvent.VK_F12;
import static java.awt.event.KeyEvent.VK_GREATER;
import static java.awt.event.KeyEvent.VK_HOME;
import static java.awt.event.KeyEvent.VK_INSERT;
import static java.awt.event.KeyEvent.VK_KP_DOWN;
import static java.awt.event.KeyEvent.VK_KP_LEFT;
import static java.awt.event.KeyEvent.VK_KP_RIGHT;
import static java.awt.event.KeyEvent.VK_KP_UP;
import static java.awt.event.KeyEvent.VK_LEFT;
import static java.awt.event.KeyEvent.VK_LEFT_PARENTHESIS;
import static java.awt.event.KeyEvent.VK_LESS;
import static java.awt.event.KeyEvent.VK_MINUS;
import static java.awt.event.KeyEvent.VK_MULTIPLY;
import static java.awt.event.KeyEvent.VK_NUMBER_SIGN;
import static java.awt.event.KeyEvent.VK_NUMPAD0;
import static java.awt.event.KeyEvent.VK_NUMPAD9;
import static java.awt.event.KeyEvent.VK_PAGE_DOWN;
import static java.awt.event.KeyEvent.VK_PAGE_UP;
import static java.awt.event.KeyEvent.VK_PAUSE;
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_QUOTEDBL;
import static java.awt.event.KeyEvent.VK_RIGHT;
import static java.awt.event.KeyEvent.VK_RIGHT_PARENTHESIS;
import static java.awt.event.KeyEvent.VK_SCROLL_LOCK;
import static java.awt.event.KeyEvent.VK_SEMICOLON;
import static java.awt.event.KeyEvent.VK_SLASH;
import static java.awt.event.KeyEvent.VK_SPACE;
import static java.awt.event.KeyEvent.VK_SUBTRACT;
import static java.awt.event.KeyEvent.VK_TAB;
import static java.awt.event.KeyEvent.VK_UNDERSCORE;
import static java.awt.event.KeyEvent.VK_UP;
import static java.awt.event.KeyEvent.VK_Z;
import java.awt.event.InputEvent;
import java.util.HashMap;
import javax.swing.KeyStroke;
import com.sun.jna.Pointer;
import com.tulskiy.keymaster.common.MediaKey;
/*
 * Copyright (c) 2011 Denis Tulskiy
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with this work.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.tulskiy.keymaster.x11;





/**
 * Author: Denis Tulskiy
 * Date: 6/13/11
 */
public class KeyMap {
    @SuppressWarnings("serial")
	private static final HashMap<Integer, Integer> common = new HashMap<Integer, Integer>() {{
        put(VK_ESCAPE, XK_Escape);
        put(VK_BACK_SPACE, XK_BackSpace);
        put(VK_TAB, XK_Tab);
        put(VK_ENTER, XK_Return);
        put(VK_PAUSE, XK_Pause);
        put(VK_SCROLL_LOCK, XK_Scroll_Lock);
        put(VK_DELETE, XK_Delete);
        put(VK_CLEAR, XK_Clear);
        put(VK_HOME, XK_Home);
        put(VK_LEFT, XK_Left);
        put(VK_UP, XK_Up);
        put(VK_RIGHT, XK_Right);
        put(VK_DOWN, XK_Down);
        put(VK_PAGE_UP, XK_Page_Up);
        put(VK_PAGE_DOWN, XK_Page_Down);
        put(VK_END, XK_End);
        put(VK_BEGIN, XK_Begin);
        put(VK_KP_DOWN, XK_KP_Down);
        put(VK_KP_UP, XK_KP_Up);
        put(VK_KP_LEFT, XK_KP_Left);
        put(VK_KP_RIGHT, XK_KP_Right);
        put(VK_SPACE, XK_space);
        put(VK_EXCLAMATION_MARK, XK_exclam);
        put(VK_QUOTEDBL, XK_quotedbl);
        put(VK_NUMBER_SIGN, XK_numbersign);
        put(VK_DOLLAR, XK_dollar);
        put(VK_AMPERSAND, XK_ampersand);
        put(VK_LEFT_PARENTHESIS, XK_parenleft);
        put(VK_RIGHT_PARENTHESIS, XK_parenright);
        put(VK_ASTERISK, XK_asterisk);
        put(VK_PLUS, XK_plus);
        put(VK_COMMA, XK_comma);
        put(VK_MINUS, XK_minus);
        put(VK_PERIOD, XK_period);
        put(VK_SLASH, XK_slash);
        put(VK_COLON, XK_colon);
        put(VK_SEMICOLON, XK_semicolon);
        put(VK_LESS, XK_less);
        put(VK_EQUALS, XK_equal);