Example usage for java.awt.event KeyEvent VK_S

List of usage examples for java.awt.event KeyEvent VK_S

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_S.

Prototype

int VK_S

To view the source code for java.awt.event KeyEvent VK_S.

Click Source Link

Document

Constant for the "S" key.

Usage

From source file:SelectingCheckBox.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox(DESELECTED_LABEL);
    // Define ActionListener
    ActionListener actionListener = new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            AbstractButton abstractButton = (AbstractButton) actionEvent.getSource();
            boolean selected = abstractButton.getModel().isSelected();
            String newLabel = (selected ? SELECTED_LABEL : DESELECTED_LABEL);
            abstractButton.setText(newLabel);
        }/*w w  w .  ja  va2  s. co  m*/
    };
    ChangeListener changeListener = new ChangeListener() {
        public void stateChanged(ChangeEvent changeEvent) {
            AbstractButton abstractButton = (AbstractButton) changeEvent.getSource();
            ButtonModel buttonModel = abstractButton.getModel();
            boolean armed = buttonModel.isArmed();
            boolean pressed = buttonModel.isPressed();
            boolean selected = buttonModel.isSelected();
            System.out.println("Changed: " + armed + "/" + pressed + "/" + selected);
        }
    };

    ItemListener itemListener = new ItemListener() {
        public void itemStateChanged(ItemEvent itemEvent) {
            AbstractButton abstractButton = (AbstractButton) itemEvent.getSource();
            Color foreground = abstractButton.getForeground();
            Color background = abstractButton.getBackground();
            int state = itemEvent.getStateChange();
            if (state == ItemEvent.SELECTED) {
                abstractButton.setForeground(background);
                abstractButton.setBackground(foreground);
            }
        }
    };

    checkBox.addActionListener(actionListener);
    checkBox.addChangeListener(changeListener);
    checkBox.addItemListener(itemListener);
    checkBox.setMnemonic(KeyEvent.VK_S);
    Container contentPane = frame.getContentPane();
    contentPane.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);
    frame.setVisible(true);
}

From source file:MenuX.java

public static void main(String args[]) {
    ActionListener actionListener = new MenuActionListener();
    MenuKeyListener menuKeyListener = new MyMenuKeyListener();
    ChangeListener cListener = new MyChangeListener();
    MenuListener menuListener = new MyMenuListener();
    MenuSelectionManager manager = MenuSelectionManager.defaultManager();
    manager.addChangeListener(cListener);
    JFrame frame = new JFrame("MenuSample Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JMenuBar bar = new VerticalMenuBar();
    //    JMenuBar bar = new JMenuBar();

    // File Menu, F - Mnemonic
    JMenu file = new JMenu("File");
    file.setMnemonic(KeyEvent.VK_F);
    file.addChangeListener(cListener);//from   w  w w. ja  va 2  s.  c o  m
    file.addMenuListener(menuListener);
    file.addMenuKeyListener(menuKeyListener);
    JPopupMenu popupMenu = file.getPopupMenu();
    popupMenu.setLayout(new GridLayout(3, 3));
    bar.add(file);

    // File->New, N - Mnemonic
    JMenuItem newItem = new JMenuItem("New", KeyEvent.VK_N);
    newItem.addActionListener(actionListener);
    newItem.addChangeListener(cListener);
    newItem.addMenuKeyListener(menuKeyListener);
    file.add(newItem);

    // File->Open, O - Mnemonic
    JMenuItem openItem = new JMenuItem("Open", KeyEvent.VK_O);
    openItem.addActionListener(actionListener);
    openItem.addChangeListener(cListener);
    openItem.addMenuKeyListener(menuKeyListener);
    file.add(openItem);

    // File->Close, C - Mnemonic
    JMenuItem closeItem = new JMenuItem("Close", KeyEvent.VK_C);
    closeItem.addActionListener(actionListener);
    closeItem.addChangeListener(cListener);
    closeItem.addMenuKeyListener(menuKeyListener);
    file.add(closeItem);

    // Separator
    file.addSeparator();

    // File->Save, S - Mnemonic
    JMenuItem saveItem = new JMenuItem("Save", KeyEvent.VK_S);
    saveItem.addActionListener(actionListener);
    saveItem.addChangeListener(cListener);
    saveItem.addMenuKeyListener(menuKeyListener);
    file.add(saveItem);

    // Separator
    file.addSeparator();

    // File->Exit, X - Mnemonic
    JMenuItem exitItem = new JMenuItem("Exit", KeyEvent.VK_X);
    exitItem.addActionListener(actionListener);
    exitItem.addChangeListener(cListener);
    exitItem.addMenuKeyListener(menuKeyListener);
    file.add(exitItem);

    // Edit Menu, E - Mnemonic
    JMenu edit = new JMenu("Edit");
    edit.setMnemonic(KeyEvent.VK_E);
    edit.addChangeListener(cListener);
    edit.addMenuListener(menuListener);
    edit.addMenuKeyListener(menuKeyListener);
    bar.add(edit);

    // Edit->Cut, T - Mnemonic, CTRL-X - Accelerator
    JMenuItem cutItem = new JMenuItem("Cut", KeyEvent.VK_T);
    cutItem.addActionListener(actionListener);
    cutItem.addChangeListener(cListener);
    cutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK));
    cutItem.addMenuKeyListener(menuKeyListener);
    edit.add(cutItem);

    // Edit->Copy, C - Mnemonic, CTRL-C - Accelerator
    JMenuItem copyItem = new JMenuItem("Copy", KeyEvent.VK_C);
    copyItem.addActionListener(actionListener);
    copyItem.addChangeListener(cListener);
    copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK));
    copyItem.addMenuKeyListener(menuKeyListener);
    copyItem.setEnabled(false);
    edit.add(copyItem);

    // Edit->Paste, P - Mnemonic, CTRL-V - Accelerator, Disabled
    JMenuItem pasteItem = new JMenuItem("Paste", KeyEvent.VK_P);
    pasteItem.addActionListener(actionListener);
    pasteItem.addChangeListener(cListener);
    pasteItem.addMenuKeyListener(menuKeyListener);
    pasteItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK));
    pasteItem.setEnabled(false);
    edit.add(pasteItem);

    // Separator
    edit.addSeparator();

    // Edit->Find, F - Mnemonic, F3 - Accelerator
    JMenuItem findItem = new JMenuItem("Find", KeyEvent.VK_F);
    findItem.addActionListener(actionListener);
    findItem.addChangeListener(cListener);
    findItem.addMenuKeyListener(menuKeyListener);
    findItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));
    edit.add(findItem);

    // Edit->Options Submenu, O - Mnemonic, at.gif - Icon Image File
    JMenu findOptions = new JMenu("Options");
    findOptions.addChangeListener(cListener);
    findOptions.addMenuListener(menuListener);
    findOptions.addMenuKeyListener(menuKeyListener);
    Icon atIcon = new ImageIcon("at.gif");
    findOptions.setIcon(atIcon);
    findOptions.setMnemonic(KeyEvent.VK_O);

    // ButtonGrou for radio buttons
    ButtonGroup directionGroup = new ButtonGroup();

    // Edit->Options->Forward, F - Mnemonic, in group
    JRadioButtonMenuItem forward = new JRadioButtonMenuItem("Forward", true);
    forward.addActionListener(actionListener);
    forward.addChangeListener(cListener);
    forward.addMenuKeyListener(menuKeyListener);
    forward.setMnemonic(KeyEvent.VK_F);
    findOptions.add(forward);
    directionGroup.add(forward);

    // Edit->Options->Backward, B - Mnemonic, in group
    JRadioButtonMenuItem backward = new JRadioButtonMenuItem("Backward");
    backward.addActionListener(actionListener);
    backward.addChangeListener(cListener);
    backward.addMenuKeyListener(menuKeyListener);
    backward.setMnemonic(KeyEvent.VK_B);
    findOptions.add(backward);
    directionGroup.add(backward);

    // Separator
    findOptions.addSeparator();

    // Edit->Options->Case Sensitive, C - Mnemonic
    JCheckBoxMenuItem caseItem = new JCheckBoxMenuItem("Case Sensitive");
    caseItem.addActionListener(actionListener);
    caseItem.addChangeListener(cListener);
    caseItem.addMenuKeyListener(menuKeyListener);
    caseItem.setMnemonic(KeyEvent.VK_C);
    findOptions.add(caseItem);
    edit.add(findOptions);

    frame.setJMenuBar(bar);
    //    frame.getContentPane().add(bar, BorderLayout.EAST);
    frame.setSize(350, 250);
    frame.setVisible(true);
}

From source file:MenuY.java

public static void main(String args[]) {
    ActionListener actionListener = new MenuActionListener();
    MenuKeyListener menuKeyListener = new MyMenuKeyListener();
    ChangeListener cListener = new MyChangeListener();
    MenuListener menuListener = new MyMenuListener();
    MenuSelectionManager manager = MenuSelectionManager.defaultManager();
    manager.addChangeListener(cListener);
    JFrame frame = new JFrame("MenuSample Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JMenuBar bar = new VerticalMenuBar();
    //    JMenuBar bar = new JMenuBar();

    // File Menu, F - Mnemonic
    JMenu file = new JMenu("File");
    file.setMnemonic(KeyEvent.VK_F);
    file.addChangeListener(cListener);/*from  w  w  w .jav a 2 s .  co  m*/
    file.addMenuListener(menuListener);
    file.addMenuKeyListener(menuKeyListener);
    JPopupMenu popupMenu = file.getPopupMenu();
    popupMenu.setLayout(new GridLayout(3, 3));
    bar.add(file);

    // File->New, N - Mnemonic
    JMenuItem newItem = new JMenuItem("New", KeyEvent.VK_N);
    newItem.addActionListener(actionListener);
    newItem.addChangeListener(cListener);
    newItem.addMenuKeyListener(menuKeyListener);
    file.add(newItem);

    // File->Open, O - Mnemonic
    JMenuItem openItem = new JMenuItem("Open", KeyEvent.VK_O);
    openItem.addActionListener(actionListener);
    openItem.addChangeListener(cListener);
    openItem.addMenuKeyListener(menuKeyListener);
    file.add(openItem);

    // File->Close, C - Mnemonic
    JMenuItem closeItem = new JMenuItem("Close", KeyEvent.VK_C);
    closeItem.addActionListener(actionListener);
    closeItem.addChangeListener(cListener);
    closeItem.addMenuKeyListener(menuKeyListener);
    file.add(closeItem);

    // Separator
    file.addSeparator();

    // File->Save, S - Mnemonic
    JMenuItem saveItem = new JMenuItem("Save", KeyEvent.VK_S);
    saveItem.addActionListener(actionListener);
    saveItem.addChangeListener(cListener);
    saveItem.addMenuKeyListener(menuKeyListener);
    file.add(saveItem);

    // Separator
    file.addSeparator();

    // File->Exit, X - Mnemonic
    JMenuItem exitItem = new JMenuItem("Exit", KeyEvent.VK_X);
    exitItem.addActionListener(actionListener);
    exitItem.addChangeListener(cListener);
    exitItem.addMenuKeyListener(menuKeyListener);
    file.add(exitItem);

    // Edit Menu, E - Mnemonic
    JMenu edit = new JMenu("Edit");
    edit.setMnemonic(KeyEvent.VK_E);
    edit.addChangeListener(cListener);
    edit.addMenuListener(menuListener);
    edit.addMenuKeyListener(menuKeyListener);
    bar.add(edit);

    // Edit->Cut, T - Mnemonic, CTRL-X - Accelerator
    JMenuItem cutItem = new JMenuItem("Cut", KeyEvent.VK_T);
    cutItem.addActionListener(actionListener);
    cutItem.addChangeListener(cListener);
    cutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK));
    cutItem.addMenuKeyListener(menuKeyListener);
    edit.add(cutItem);

    // Edit->Copy, C - Mnemonic, CTRL-C - Accelerator
    JMenuItem copyItem = new JMenuItem("Copy", KeyEvent.VK_C);
    copyItem.addActionListener(actionListener);
    copyItem.addChangeListener(cListener);
    copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK));
    copyItem.addMenuKeyListener(menuKeyListener);
    copyItem.setEnabled(false);
    edit.add(copyItem);

    // Edit->Paste, P - Mnemonic, CTRL-V - Accelerator, Disabled
    JMenuItem pasteItem = new JMenuItem("Paste", KeyEvent.VK_P);
    pasteItem.addActionListener(actionListener);
    pasteItem.addChangeListener(cListener);
    pasteItem.addMenuKeyListener(menuKeyListener);
    pasteItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK));
    pasteItem.setEnabled(false);
    edit.add(pasteItem);

    // Separator
    edit.addSeparator();

    // Edit->Find, F - Mnemonic, F3 - Accelerator
    JMenuItem findItem = new JMenuItem("Find", KeyEvent.VK_F);
    findItem.addActionListener(actionListener);
    findItem.addChangeListener(cListener);
    findItem.addMenuKeyListener(menuKeyListener);
    findItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));
    edit.add(findItem);

    // Edit->Options Submenu, O - Mnemonic, at.gif - Icon Image File
    Icon atIcon = new ImageIcon("at.gif");
    Action findAction = new AbstractAction("Options", atIcon) {
        ActionListener actionListener = new MenuActionListener();

        public void actionPerformed(ActionEvent e) {
            actionListener.actionPerformed(e);
        }
    };
    findAction.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_O));
    JMenuItem jMenuItem = new JMenuItem(findAction);

    JMenu findOptions = new JMenu(findAction);
    findOptions.addChangeListener(cListener);
    findOptions.addMenuListener(menuListener);
    findOptions.addMenuKeyListener(menuKeyListener);

    // ButtonGrou for radio buttons
    ButtonGroup directionGroup = new ButtonGroup();

    // Edit->Options->Forward, F - Mnemonic, in group
    JRadioButtonMenuItem forward = new JRadioButtonMenuItem("Forward", true);
    forward.addActionListener(actionListener);
    forward.addChangeListener(cListener);
    forward.addMenuKeyListener(menuKeyListener);
    forward.setMnemonic(KeyEvent.VK_F);
    findOptions.add(forward);
    directionGroup.add(forward);

    // Edit->Options->Backward, B - Mnemonic, in group
    JRadioButtonMenuItem backward = new JRadioButtonMenuItem("Backward");
    backward.addActionListener(actionListener);
    backward.addChangeListener(cListener);
    backward.addMenuKeyListener(menuKeyListener);
    backward.setMnemonic(KeyEvent.VK_B);
    findOptions.add(backward);
    directionGroup.add(backward);

    // Separator
    findOptions.addSeparator();

    // Edit->Options->Case Sensitive, C - Mnemonic
    JCheckBoxMenuItem caseItem = new JCheckBoxMenuItem("Case Sensitive");
    caseItem.addActionListener(actionListener);
    caseItem.addChangeListener(cListener);
    caseItem.addMenuKeyListener(menuKeyListener);
    caseItem.setMnemonic(KeyEvent.VK_C);
    findOptions.add(caseItem);
    edit.add(findOptions);

    frame.setJMenuBar(bar);
    //    frame.getContentPane().add(bar, BorderLayout.EAST);
    frame.setSize(350, 250);
    frame.setVisible(true);
}

From source file:com.hp.test.framework.jelly.SelectSaveandOKonDownloadDialogTag.java

@Override
public void doTag(XMLOutput arg0) throws MissingAttributeException {
    logger.info("Started Execution of SelectSaveandOKonDownloadDialogTag");
    WebDriver driver = getSelenium();//  ww  w.  j ava 2  s  . com

    try {
        Robot robot = new Robot();

        //Pressky ALT+S
        robot.keyPress(KeyEvent.VK_ALT);
        robot.keyPress(KeyEvent.VK_S);

        //Release ALT
        robot.keyRelease(KeyEvent.VK_ALT);

        //Press Enter
        robot.keyPress(KeyEvent.VK_ENTER);

        //Release Enter
        robot.keyRelease(KeyEvent.VK_ENTER);

    } catch (AWTException e) {
        logger.error("Exception in the Save and Ok on Download dialog" + "\n" + e.getMessage());
    }

    logger.info("Completed Execution of SelectSaveandOKonDownloadDialogTag");
}

From source file:Main.java

public Main(String title) {
    super(title);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JMenuBar menuBar = new JMenuBar();
    tabComponentsItem = new JCheckBoxMenuItem("Use TabComponents", true);
    tabComponentsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.ALT_MASK));
    tabComponentsItem.addActionListener(e -> {
        for (int i = 0; i < pane.getTabCount(); i++) {
            if (tabComponentsItem.isSelected()) {
            } else {
                pane.setTabComponentAt(i, null);
            }//from   ww w  .  jav  a  2 s . c o  m
        }
    });
    scrollLayoutItem = new JCheckBoxMenuItem("Set ScrollLayout");
    scrollLayoutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.ALT_MASK));
    scrollLayoutItem.addActionListener(e -> {
        if (pane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) {
            pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        } else {
            pane.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);
        }
    });
    JMenuItem resetItem = new JMenuItem("Reset JTabbedPane");
    resetItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_MASK));
    resetItem.addActionListener(e -> runTest());
    JMenu optionsMenu = new JMenu("Options");
    optionsMenu.add(tabComponentsItem);
    optionsMenu.add(scrollLayoutItem);
    optionsMenu.add(resetItem);
    menuBar.add(optionsMenu);
    setJMenuBar(menuBar);
    add(pane);
}

From source file:ca.sfu.federation.action.CreateScenarioAction.java

public CreateScenarioAction() {
    super("Create Scenario", null);
    Icon icon = ImageIconUtils.loadIconById("model-create-scenario");
    this.putValue(Action.LONG_DESCRIPTION, "Create Scenario");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_S);
    this.putValue(Action.SHORT_DESCRIPTION, "Create Scenario");
    this.putValue(Action.SMALL_ICON, icon);
}

From source file:com.stefanbrenner.droplet.ui.actions.SaveFileAction.java

public SaveFileAction(final JFrame frame, final JFileChooser fileChooser,
        final IDropletContext dropletContext) {
    this(Messages.getString("SaveFileAction.title"), frame, fileChooser, dropletContext); //$NON-NLS-1$

    putValue(Action.ACCELERATOR_KEY, UiUtils.getAccelerator(KeyEvent.VK_S));
    putValue(Action.MNEMONIC_KEY, UiUtils.getMnemonic(Messages.getString("SaveFileAction.mnemonic"))); //$NON-NLS-1$
    putValue(Action.SHORT_DESCRIPTION, Messages.getString("SaveFileAction.description")); //$NON-NLS-1$
}

From source file:org.gitools.ui.app.actions.file.ExportScaleImageAction.java

public ExportScaleImageAction() {
    super("Color scale to image");

    setDesc("Export the scale as an image file");
    setMnemonic(KeyEvent.VK_S);
}

From source file:Main.java

/**
 * Returns the mnemonic integer./*  w w w .  j a va 2s. c  o  m*/
 * 
 * @param c The character (uppercase)
 * @return The mnemonic.
 */
@SuppressWarnings("incomplete-switch")
private static int setMnemonicsGet(char c) {
    int mnemonic = 0;
    switch (Character.toUpperCase(c)) {
    case '0':
        mnemonic = KeyEvent.VK_0;
        break;
    case '1':
        mnemonic = KeyEvent.VK_1;
        break;
    case '2':
        mnemonic = KeyEvent.VK_2;
        break;
    case '3':
        mnemonic = KeyEvent.VK_3;
        break;
    case '4':
        mnemonic = KeyEvent.VK_4;
        break;
    case '5':
        mnemonic = KeyEvent.VK_5;
        break;
    case '6':
        mnemonic = KeyEvent.VK_6;
        break;
    case '7':
        mnemonic = KeyEvent.VK_7;
        break;
    case '8':
        mnemonic = KeyEvent.VK_8;
        break;
    case '9':
        mnemonic = KeyEvent.VK_9;
        break;
    case 'A':
        mnemonic = KeyEvent.VK_A;
        break;
    case 'B':
        mnemonic = KeyEvent.VK_B;
        break;
    case 'C':
        mnemonic = KeyEvent.VK_C;
        break;
    case 'D':
        mnemonic = KeyEvent.VK_D;
        break;
    case 'E':
        mnemonic = KeyEvent.VK_E;
        break;
    case 'F':
        mnemonic = KeyEvent.VK_F;
        break;
    case 'G':
        mnemonic = KeyEvent.VK_G;
        break;
    case 'H':
        mnemonic = KeyEvent.VK_H;
        break;
    case 'I':
        mnemonic = KeyEvent.VK_I;
        break;
    case 'J':
        mnemonic = KeyEvent.VK_J;
        break;
    case 'K':
        mnemonic = KeyEvent.VK_K;
        break;
    case 'L':
        mnemonic = KeyEvent.VK_L;
        break;
    case 'M':
        mnemonic = KeyEvent.VK_M;
        break;
    case 'N':
        mnemonic = KeyEvent.VK_N;
        break;
    case 'O':
        mnemonic = KeyEvent.VK_O;
        break;
    case 'P':
        mnemonic = KeyEvent.VK_P;
        break;
    case 'Q':
        mnemonic = KeyEvent.VK_Q;
        break;
    case 'R':
        mnemonic = KeyEvent.VK_R;
        break;
    case 'S':
        mnemonic = KeyEvent.VK_S;
        break;
    case 'T':
        mnemonic = KeyEvent.VK_T;
        break;
    case 'U':
        mnemonic = KeyEvent.VK_U;
        break;
    case 'V':
        mnemonic = KeyEvent.VK_V;
        break;
    case 'W':
        mnemonic = KeyEvent.VK_W;
        break;
    case 'X':
        mnemonic = KeyEvent.VK_X;
        break;
    case 'Y':
        mnemonic = KeyEvent.VK_Y;
        break;
    case 'Z':
        mnemonic = KeyEvent.VK_Z;
        break;
    }
    return mnemonic;
}

From source file:com.au.splashinc.JControl.Load.DarkForcesJsonLoader.java

public void LoadConfig() {
    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    //JSON organised in [Button/Axis/POV],{[TypeofAction],[Value]}
    /*W- up - LeftStick Up
    A - Left - Right Stick Left - X Rot -
    S - back - LeftStick Down - Y Axis up
    d - right - Right Stick Right - x Rot +
    Space - jump - A - 1// w  ww.  j  a va 2  s . c  o m
    c - Crouch - Right Stick In - 10
    Mouse 1 - primary fire - Right Trigger - z axis -
    Shift - Run - Left Stick in - 9
    Capslock - Walk - LB - 5
    e - Open/interact - B - 2
    R - Secondary Fire - Left Trigger - z axis +
    Pageup - Look Up - Right Stick Up - Y Rot -
    PageDown - Loop Down - Right Stick Down - y Rot +
    f1 - pda - Back - 3
    f2 - night vision - dpad down
    f3- fleats - dpad left
    f4 - gasmask - dpad right
    f5 - headlamp - dpad up*/
    JSONArray simpleKey = new JSONArray();
    simpleKey.add(GetJSONObject("Button 0", KeyEvent.VK_SPACE));
    simpleKey.add(GetJSONObject("Button 2", KeyEvent.VK_E));
    simpleKey.add(GetJSONObject("Button 8", KeyEvent.VK_F1));
    simpleKey.add(GetJSONObject("Button 7", KeyEvent.VK_CAPS_LOCK));
    simpleKey.add(GetJSONObject("Button 3", KeyEvent.VK_SHIFT));
    simpleKey.add(GetJSONObject("Button 1", KeyEvent.VK_C));
    simpleKey.add(GetJSONObject("X Axis -", KeyEvent.VK_A));
    simpleKey.add(GetJSONObject("X Axis +", KeyEvent.VK_D));
    simpleKey.add(GetJSONObject("Y Axis -", KeyEvent.VK_W));
    simpleKey.add(GetJSONObject("Y Axis +", KeyEvent.VK_S));
    simpleKey.add(GetJSONObject("Hat Switch 0 0.25", KeyEvent.VK_F5));
    simpleKey.add(GetJSONObject("Hat Switch 0 0.5", KeyEvent.VK_F4));
    simpleKey.add(GetJSONObject("Hat Switch 0 0.75", KeyEvent.VK_F2));
    simpleKey.add(GetJSONObject("Hat Switch 0 1.0", KeyEvent.VK_F3));
    simpleKey.add(GetJSONObject("Z Axis +", KeyEvent.VK_R));
    simpleKey.add(GetJSONObject("Y Rotation +", KeyEvent.VK_PAGE_UP));
    simpleKey.add(GetJSONObject("Y Rotation -", KeyEvent.VK_PAGE_DOWN));
    JSONArray simpleMouse = new JSONArray();
    simpleMouse.add(GetJSONObject("X Rotation", "LeftRight"));
    simpleMouse.add(GetJSONObject("Z Axis -", InputEvent.BUTTON1_MASK));
    //JSONObject jo = new JSONObject();
    //jo.put("Button 0", KeyEvent.VK_SPACE);
    //jo.put("Button 2", KeyEvent.VK_E);
    //jo.pu
    //simpleKey.add(jo);
    /*JSONObject j1 = new JSONObject();
    j1.put("Button 2", KeyEvent.VK_E);
    simpleKey.add(j1);*/
    json.put(ControllerAction.SIMPLE_BUTTON.toString(), simpleKey);
    json.put(ControllerAction.SIMPLE_MOUSE.toString(), simpleMouse);
    /*json.put("Button 0", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_SPACE));
    json.put("Button 2", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_E));
    json.put("Button 8", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_F1));
    json.put("Button 7", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_CAPS_LOCK));
    json.put("Button 3", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_SHIFT));
    json.put("Button 1", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_C));
    json.put("X Axis -", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_A));
    json.put("X Axis +", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_D));
    json.put("Y Axis -", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_W));
    json.put("Y Axis +", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_S));
    json.put("Hat Switch 0 0.25", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_F5));
    json.put("Hat Switch 0 0.5", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_F4));
    json.put("Hat Switch 0 0.75", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_F2));
    json.put("Hat Switch 0 1.0", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_F3));
    json.put("Z Axis +", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_R));
    json.put("Z Axis -", GetSimpleButton(ControllerAction.SIMPLE_MOUSE.toString(), InputEvent.BUTTON1_MASK));
    json.put("X Rotation", GetSimpleButton(ControllerAction.SIMPLE_MOUSE.toString(), "LeftRight"));
    json.put("Y Rotation +", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_PAGE_UP));
    json.put("Y Rotation -", GetSimpleButton(ControllerAction.SIMPLE_BUTTON.toString(), KeyEvent.VK_PAGE_DOWN));*/
    //json.put("Button 4,5", this)

    controllerDetail = json.toJSONString();
    System.out.println(json.toJSONString());
    JsonLoaderHelper jsh = new JsonLoaderHelper(json);

    keyDownMap = jsh.getKeyDownMap();
    keyUpMap = jsh.getKeyUpMap();
    mouseMoveMap = jsh.getMouseMoveMap();
    mouseButtonDownMap = jsh.getMouseButtonDownMap();
    mouseButtonUpMap = jsh.getMouseButtonUpMap();
}