Java Code Examples for java.awt.event.KeyEvent#VK_L

The following examples show how to use java.awt.event.KeyEvent#VK_L . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalculadoraTela.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
public void operarComTeclaDigitada(java.awt.event.KeyEvent evt) {
    // Se foi digitado uma das teclas a seguir
    if ((evt.getKeyCode() == KeyEvent.VK_0)
            || (evt.getKeyCode() == KeyEvent.VK_1)
            || (evt.getKeyCode() == KeyEvent.VK_2)
            || (evt.getKeyCode() == KeyEvent.VK_3)
            || (evt.getKeyCode() == KeyEvent.VK_4)
            || (evt.getKeyCode() == KeyEvent.VK_5)
            || (evt.getKeyCode() == KeyEvent.VK_6)
            || (evt.getKeyCode() == KeyEvent.VK_7)
            || (evt.getKeyCode() == KeyEvent.VK_8)
            || (evt.getKeyCode() == KeyEvent.VK_9)
            || (evt.getKeyCode() == KeyEvent.VK_ADD)
            || (evt.getKeyCode() == KeyEvent.VK_SUBTRACT)
            || (evt.getKeyCode() == KeyEvent.VK_DIVIDE)
            || (evt.getKeyCode() == KeyEvent.VK_MULTIPLY)
            || (evt.getKeyCode() == KeyEvent.VK_EQUALS)) {

        this.operarConformeEstado("" + evt.getKeyChar());

    } else if (evt.getKeyCode() == KeyEvent.VK_L) {
        this.operarConformeEstado("Limpar");
    }
}
 
Example 2
Source File: RobotKeyPressMidi.java    From haxademic with MIT License 5 votes vote down vote up
protected void firstFrame() {
	MidiDevice.init(0, 0);
	try { _robot = new Robot(); } catch( Exception error ) { println("couldn't init Robot"); }
	
	midiKeyTriggers = new MidiKeyTrigger[] {
			new MidiKeyTrigger(39, KeyEvent.VK_V),
			new MidiKeyTrigger(40, KeyEvent.VK_A),
			new MidiKeyTrigger(54, KeyEvent.VK_B),
			new MidiKeyTrigger(65, KeyEvent.VK_L)
	};
}
 
Example 3
Source File: SmoothMoves.java    From filthy-rich-clients with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Toggles various rendering flags
 */
public void keyPressed(KeyEvent ke) {
    int keyCode = ke.getKeyCode();
    if (keyCode == KeyEvent.VK_B) {
        // B: Motion blur - displays trail of ghost images
        motionBlur = !motionBlur;
    } else if (keyCode == KeyEvent.VK_A) {
        // A: Antialiasing - Displays soft edges around graphics
        useAA = !useAA;
        createAnimationImage();
    } else if (keyCode == KeyEvent.VK_C) {
        // C: Color - Toggles rectangle color between dark and light colors
        alterColor = !alterColor;
        createAnimationImage();
    } else if (keyCode == KeyEvent.VK_I) {
        // I: Image - Toggles use of image or filled rectangle to show how 
        // straight edges affect animation perception
        useImage = !useImage;
        createAnimationImage();
    } else if (keyCode == KeyEvent.VK_UP) {
        // Up Arrow: Speed - Speeds up frame rate
        changeResolution(true);
    } else if (keyCode == KeyEvent.VK_DOWN) {
        // Down Arrow: Speed - Slows down frame rate
        changeResolution(false);
    } else if (keyCode == KeyEvent.VK_L) {
        // L: Linearity: Toggles linear/nonlinear motion
        linear = !linear;
    } else if (keyCode >= KeyEvent.VK_1 && keyCode <= KeyEvent.VK_9) {
        // 0-9: Blur size: Toggles size of ghost trail for motion blur
        blurSize = keyCode - KeyEvent.VK_0;
        prevMoveX = prevMoveY = null;
    }
}
 
Example 4
Source File: ShortcutListener.java    From jeddict with Apache License 2.0 5 votes vote down vote up
@Override
public void keyPressed(KeyEvent e) {
    super.keyPressed(e);
    if (e.isControlDown() == true) {
        if (e.getKeyCode() == KeyEvent.VK_L) {
            SQLEditorUtil.openEditor(file, ((DBMapping) file.getModelerScene().getBaseElementSpec()).getSQL());
        }else if (e.getKeyCode() == KeyEvent.VK_B) {
            JSONBUtil.openJSONBViewer(file.getParentFile());
        } else if (e.getKeyCode() == KeyEvent.VK_G) {
            JPAModelerUtil.generateSourceCode(file.getParentFile());
        }
    }

}
 
Example 5
Source File: FunctionPanel.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
public void keyPressed(KeyEvent e) {
   if (e.getKeyCode() == KeyEvent.VK_CONTROL) {
      picking = true;
   } else if (e.getKeyCode() == KeyEvent.VK_I) {
      zoomPlot(lastMouseX, lastMouseY, true);
   } else if (e.getKeyCode() == KeyEvent.VK_O) {
      zoomPlot(lastMouseX, lastMouseY, false);
   } else if (e.getKeyCode() == KeyEvent.VK_L || e.getKeyCode() == KeyEvent.VK_R ||
              e.getKeyCode() == KeyEvent.VK_U || e.getKeyCode() == KeyEvent.VK_D) {
      panPlot(e.getKeyCode());
   } else if (e.getKeyCode() == KeyEvent.VK_DELETE) {
      deleteSelectedNodes();
   }
}
 
Example 6
Source File: UtilLoggingXmlLogImporter.java    From otroslogviewer with Apache License 2.0 4 votes vote down vote up
@Override
public int getMnemonic() {
  return KeyEvent.VK_L;
}
 
Example 7
Source File: MainFrame.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Creates the tools menu.
 *
 * @return the j menu
 */
private JMenu createToolsMenu() {
  JMenu toolsMenu = new JMenu("Tools");
  toolsMenu.setMnemonic(KeyEvent.VK_T);
  this.tsViewerItem = new JMenuItem("View Typesystem", KeyEvent.VK_T);
  this.tsViewerItem.addActionListener(new ShowTypesystemHandler(this));
  this.tsViewerItem.setEnabled(false);
  toolsMenu.add(this.tsViewerItem);
  this.allAnnotationViewerItem = new JMenuItem("Show Selected Annotations", KeyEvent.VK_A);
  this.allAnnotationViewerItem.addActionListener(new ShowAnnotatedTextHandler(this));
  toolsMenu.add(this.allAnnotationViewerItem);
  this.allAnnotationViewerItem.setEnabled(false);
  this.acdItem = new JMenuItem("Customize Annotation Display", KeyEvent.VK_C);
  toolsMenu.add(this.acdItem);
  this.acdItem.setEnabled(false);
  this.acdItem.addActionListener(new ShowAnnotationCustomizerHandler(this));

  JMenu logConfig = new JMenu("Set Log Level");
  ButtonGroup levelGroup = new ButtonGroup();

  // get current log level setting
  String curLogLevel = LogManager.getLogManager().getProperty(".level");

  // create log config menu with available log levels
  Iterator<Level> levelIt = MainFrame.logLevels.iterator();
  while (levelIt.hasNext()) {
    Level level = levelIt.next();
    JRadioButtonMenuItem item = new JRadioButtonMenuItem(level.toString());
    // select current log level
    if (level.toString().equals(curLogLevel)) {
      item.setSelected(true);
    }
    item.addActionListener(new SetLogConfigHandler());
    levelGroup.add(item);
    logConfig.add(item);
  }
  toolsMenu.add(logConfig);

  JMenuItem logViewer = new JMenuItem("View Log File", KeyEvent.VK_L);
  logViewer.addActionListener(new ActionListener() {

    @Override
    public void actionPerformed(ActionEvent event) {
      LogFileViewer viewer = new LogFileViewer("Log file: "
          + MainFrame.this.logFile.getAbsolutePath());
      viewer.addWindowListener(new CloseLogViewHandler(MainFrame.this));
      Dimension dim = getDimension(logViewSizePref);
      if (dim == null) {
        dim = logFileDimensionDefault;
      }
      viewer.init(MainFrame.this.logFile, dim);
    }
  });
  toolsMenu.add(logViewer);

  return toolsMenu;
}
 
Example 8
Source File: MainFrame.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Creates the run menu.
 *
 * @return the j menu
 */
private JMenu createRunMenu() {
  JMenu runMenu = new JMenu("Run");
  runMenu.setMnemonic(KeyEvent.VK_R);
  JMenuItem runMenuItem = new JMenuItem("Load AE", KeyEvent.VK_L);
  runMenuItem.addActionListener(new AnnotatorOpenEventHandler(this));
  runMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.CTRL_MASK));
  runMenu.add(runMenuItem);
  this.reRunMenu = new JMenuItem("Run AE", KeyEvent.VK_R);
  this.reRunMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
  runMenu.add(this.reRunMenu);
  this.reRunMenu.addActionListener(new AnnotatorRerunEventHandler(this));
  this.reRunMenu.setEnabled(false);
  this.runOnCasMenuItem = new JMenuItem("Run AE on CAS", KeyEvent.VK_Y);
  this.runOnCasMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y,
      ActionEvent.CTRL_MASK));
  runMenu.add(this.runOnCasMenuItem);
  this.runOnCasMenuItem.addActionListener(new AnnotatorRunOnCasEventHandler(this));
  this.runOnCasMenuItem.setEnabled(false);
  this.runCPCMenu = new JMenuItem("Run collectionProcessComplete");
  runMenu.add(this.runCPCMenu);
  this.runCPCMenu.addActionListener(new AnnotatorRunCPCEventHandler(this));
  this.runCPCMenu.setEnabled(false);
  this.showPerfReportItem = new JMenuItem("Performance report");
  this.showPerfReportItem.setEnabled(false);
  this.showPerfReportItem.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      if (MainFrame.this.lastRunProcessTrace == null) {
        MainFrame.this.showError("No performance report to show.");
      } else {
        PerformanceReportDialog prd = new PerformanceReportDialog(MainFrame.this);
        prd.displayStats(MainFrame.this.lastRunProcessTrace, 1, "Process trace");
      }
    }
  });
  runMenu.add(this.showPerfReportItem);
  runMenu.addSeparator();
  this.recentDescFileMenu = new JMenu("Recently used ...");
  this.recentDescFileMenu.setMnemonic(KeyEvent.VK_U);
  runMenu.add(this.recentDescFileMenu);
  runMenu.addSeparator();
  createLangMenu();
  runMenu.add(this.langMenu);
  this.langMenu.setMnemonic(KeyEvent.VK_L);
  // runMenu.addSeparator();
  JMenuItem dataPathItem = new JMenuItem("Set data path");
  dataPathItem.addActionListener(new SetDataPathHandler(this));
  dataPathItem.setMnemonic(KeyEvent.VK_S);
  runMenu.addSeparator();
  runMenu.add(dataPathItem);
  return runMenu;
}
 
Example 9
Source File: MainFrame.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Creates the file menu.
 */
private void createFileMenu() {
  this.fileMenu = new JMenu("File");

  // Standard text file menu items.
  JMenuItem newTextItem = new JMenuItem("New Text...", KeyEvent.VK_N);
  newTextItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
  newTextItem.addActionListener(new NewTextEventHandler(this));
  this.fileMenu.add(newTextItem);
  this.fileMenu.setMnemonic(KeyEvent.VK_F);
  JMenuItem fileOpen = new JMenuItem("Open Text File", KeyEvent.VK_O);
  fileOpen.addActionListener(new FileOpenEventHandler(this));
  fileOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
  this.fileMenu.add(fileOpen);
  this.fileSaveItem = new JMenuItem("Save Text File", KeyEvent.VK_S);
  this.fileSaveItem.setEnabled(false);
  this.fileSaveItem.addActionListener(new FileSaveEventHandler(this));
  this.fileSaveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
  this.fileMenu.add(this.fileSaveItem);
  JMenuItem fileSaveAsItem = new JMenuItem("Save Text As...", KeyEvent.VK_A);
  fileSaveAsItem.addActionListener(new FileSaveAsEventHandler(this));
  this.fileMenu.add(fileSaveAsItem);
  createCPMenu();
  this.cpMenu.setMnemonic(KeyEvent.VK_P);
  this.fileMenu.add(this.cpMenu);
  this.fileMenu.addSeparator();
  this.recentTextFileMenu = new JMenu("Recently used ...");
  this.recentTextFileMenu.setMnemonic(KeyEvent.VK_U);
  this.fileMenu.add(this.recentTextFileMenu);
  this.fileMenu.addSeparator();

  // Color preferences
  JMenuItem colorPrefsOpenItem = new JMenuItem("Load Color Settings", KeyEvent.VK_L);
  colorPrefsOpenItem.addActionListener(new ColorPrefsOpenHandler(this));
  this.fileMenu.add(colorPrefsOpenItem);
  JMenuItem colorPrefsSaveItem = new JMenuItem("Save Color Settings", KeyEvent.VK_C);
  colorPrefsSaveItem.addActionListener(new ColorPrefsSaveHandler(this));
  this.fileMenu.add(colorPrefsSaveItem);
  this.fileMenu.addSeparator();

  // Reading and writing type system files.
  this.typeSystemReadItem = new JMenuItem("Read Type System File");
  this.typeSystemReadItem.setEnabled(true);
  this.typeSystemReadItem.addActionListener(new TypeSystemFileOpenEventHandler(this));
  this.fileMenu.add(this.typeSystemReadItem);
  this.typeSystemWriteItem = new JMenuItem("Write Type System File");
  this.typeSystemWriteItem.addActionListener(new XCASSaveTSHandler(this));
  this.fileMenu.add(this.typeSystemWriteItem);
  this.fileMenu.addSeparator();

  // Reading and writing XMI CAS files.
  this.xmiCasReadItem = new JMenuItem("Read XMI CAS File");
  this.xmiCasReadItem.addActionListener(new XmiCasFileOpenHandler(this));
  this.fileMenu.add(this.xmiCasReadItem);
  this.xmiCasWriteItem = new JMenuItem("Write XMI CAS File");
  this.xmiCasWriteItem.addActionListener(new XmiCasSaveHandler(this));
  this.fileMenu.add(this.xmiCasWriteItem);
  this.fileMenu.addSeparator();

  // Reading and writing old-style XCAS files.
  this.xcasReadItem = new JMenuItem("Read XCAS File", KeyEvent.VK_R);
  this.xcasReadItem.addActionListener(new XCASFileOpenEventHandler(this));
  this.fileMenu.add(this.xcasReadItem);
  this.xcasWriteItem = new JMenuItem("Write XCAS File", KeyEvent.VK_W);
  this.xcasWriteItem.addActionListener(new XCASSaveHandler(this));
  this.fileMenu.add(this.xcasWriteItem);
  this.fileMenu.addSeparator();
  JMenuItem exit = new JMenuItem("Exit", KeyEvent.VK_X);
  exit.addActionListener(new SystemExitHandler(this));
  this.fileMenu.add(exit);

  // Disable menu items that can't be executed yet.
  this.typeSystemWriteItem.setEnabled(false);
  setEnableCasFileReadingAndWriting();
}
 
Example 10
Source File: Commander.java    From Scripts with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void keyPressed(final KeyEvent ke) {

	final int key = ke.getKeyCode();
	final Object source = ke.getSource();
	final boolean meta = (ke.getModifiers() & Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
	final boolean metaShift = meta && ke.isShiftDown();

	// Close if Esc, Ctrl+W or Cmd+W
	if (key == KeyEvent.VK_ESCAPE || (key == KeyEvent.VK_W && meta)) {
		quit();

		// Trigger Menu accelerators
	} else if (metaShift) {
		if (key == KeyEvent.VK_C) // Enter/Exit Console
			toggleConsoleMode();
		else if (key == KeyEvent.VK_G) // Go To...
			changeDirectory("");
		else if (!isConsoleMode() && key == KeyEvent.VK_R) // Reveal Path
			Utils.revealFile(path);

	} else if (meta) {

		if (key == KeyEvent.VK_L) {
			prompt.requestFocusInWindow();
			prompt.selectAll();
		} else if (key == KeyEvent.VK_B) {
			activateTable();
		} else if (key == KeyEvent.VK_COMMA) {
			showOptionsDialog();
		} else if (key == KeyEvent.VK_S) {
			saveQuery();
		} else if (!isConsoleMode() && key == KeyEvent.VK_D) {
			addBookmark();
		} else if (!isConsoleMode() && key == KeyEvent.VK_P) {
			printList();
		} else if (!isConsoleMode() && key == KeyEvent.VK_R) {
			resetFileList("Contents reloaded...");
		}

	} else if (source == prompt) {

		// Up or down arrows pressed in prompt: Move the focus to list
		if (key == KeyEvent.VK_UP || key == KeyEvent.VK_DOWN) {
			activateTable();
		}

	} else if (source == table) {

		// Focus in list and left arrow key: move up in directory hierarchy
		if (key == KeyEvent.VK_LEFT) {
			selectParentDirectory(path);
			setSelectedItem(table.getSelectedRow());

			// Focus in list and right arrow key: List sub-directory
		} else if (key == KeyEvent.VK_RIGHT) {
			setSelectedItem(table.getSelectedRow());
			if (isFolder(selectedItem))
				selectSubDirectory(selectedItem);

			// Focus in list and enter: Open selected item
		} else if (key == KeyEvent.VK_ENTER) {
			ke.consume();
			setSelectedItem(table.getSelectedRow());
			openItem(selectedItem);

			// Focus in list and backspace: Switch focus back to prompt
		} else if (key == KeyEvent.VK_BACK_SPACE) {
			prompt.requestFocusInWindow();
			prompt.selectAll();

			// Focus in list and up/down arrow key: Loop through list
		} else if (key == KeyEvent.VK_UP) {
			if (table.getSelectedRow() == 0)
				table.setRowSelectionInterval(tableModel.getRowCount() - 1, tableModel.getRowCount() - 1);
		} else if (key == KeyEvent.VK_DOWN) {
			if (table.getSelectedRow() == tableModel.getRowCount() - 1)
				table.setRowSelectionInterval(0, 0);
		}

	}

}
 
Example 11
Source File: View2D.java    From energy2d with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void processKeyReleased(KeyEvent e) {
	if (runHeatingThread) {
		if (e.getKeyCode() == KeyEvent.VK_SHIFT) {
			cooling = false;
		}
	}
	switch (e.getKeyCode()) {
	case KeyEvent.VK_DELETE:
	case KeyEvent.VK_BACK_SPACE:
		// this is different than cut() in that it doesn't create a copy for pasting
		if (selectedManipulable != null) {
			if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete the selected object?", "Delete Object", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
				undoManager.addEdit(new UndoRemoveManipulable(this));
				notifyManipulationListeners(selectedManipulable, ManipulationEvent.DELETE);
				setSelectedManipulable(null);
			}
		} else {
			if (showGraph) {
				if (JOptionPane.showConfirmDialog(this, "Are you sure you want to erase the graph?", "Erase Graph", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
					eraseGraph();
				}
			}
		}
		break;
	case KeyEvent.VK_R:
		notifyManipulationListeners(null, runToggle ? ManipulationEvent.STOP : ManipulationEvent.RUN);
		break;
	case KeyEvent.VK_T:
		notifyManipulationListeners(null, ManipulationEvent.RESET);
		break;
	case KeyEvent.VK_L:
		notifyManipulationListeners(null, ManipulationEvent.RELOAD);
		break;
	case KeyEvent.VK_S: // avoid conflict with the save keystroke
		if (!e.isControlDown() && !e.isMetaDown() && !e.isAltDown())
			notifyManipulationListeners(null, ManipulationEvent.SUN_SHINE);
		break;
	case KeyEvent.VK_Q:
		notifyManipulationListeners(null, ManipulationEvent.SUN_ANGLE_INCREASE);
		break;
	case KeyEvent.VK_W:
		notifyManipulationListeners(null, ManipulationEvent.SUN_ANGLE_DECREASE);
		break;
	case KeyEvent.VK_G:
		showGraph = !showGraph;
		notifyGraphListeners(showGraph ? GraphEvent.GRAPH_OPENED : GraphEvent.GRAPH_CLOSED);
		break;
	case KeyEvent.VK_ESCAPE: // allow the app to shut down when in full screen mode
		Object r = getClientProperty("close_full_screen");
		if (r instanceof Runnable)
			((Runnable) r).run();
		break;
	}
	repaint();
	tipText = null;
	// e.consume();//don't call, or this stops key binding
}
 
Example 12
Source File: KeyToggler.java    From Any-Angle-Pathfinding with The Unlicense 4 votes vote down vote up
@Override
public void keyPressed(KeyEvent arg0) {
    switch(arg0.getKeyCode()) {
        case KeyEvent.VK_RIGHT :
            goRight(1, false);
            break;
        case KeyEvent.VK_LEFT :
            goLeft(1, false);
            break;
        case KeyEvent.VK_UP :
            goRight(1, true);
            break;
        case KeyEvent.VK_DOWN :
            goLeft(1, true);
            break;
        case KeyEvent.VK_PAGE_UP :
            goRight(10, false);
            break;
        case KeyEvent.VK_PAGE_DOWN :
            goLeft(10, false);
            break;
        case KeyEvent.VK_D :
            goRight(3, true);
            break;
        case KeyEvent.VK_A :
            goLeft(3, true);
            break;
        case KeyEvent.VK_W :
            goRight(5, true);
            break;
        case KeyEvent.VK_S :
            goLeft(5, true);
            break;
            

            // O: Go right one step + take screenshot, loops around
        case KeyEvent.VK_O :
            if (goRight(1, false))
                takeSnapShot();
            break;

            // P: Go right one step + take screenshot, stop at end
        case KeyEvent.VK_P :
            if (goRight(1, true))
                takeSnapShot();
            break;

            // L: Go right multiple steps + take screenshot, stop at end
        case KeyEvent.VK_L :
            if (goRight(13, true))
                takeSnapShot();
            break;
            // Esc: Close Window
        case KeyEvent.VK_ESCAPE :
            System.exit(0);
            break;
    }
}
 
Example 13
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getUpperCaseAlphaChar(int code) {
	switch (code) {
	case KeyEvent.VK_Q:
		return "Q";
	case KeyEvent.VK_W:
		return "W";
	case KeyEvent.VK_E:
		return "E";
	case KeyEvent.VK_R:
		return "R";
	case KeyEvent.VK_T:
		return "T";
	case KeyEvent.VK_Y:
		return "Y";
	case KeyEvent.VK_U:
		return "U";
	case KeyEvent.VK_I:
		return "I";
	case KeyEvent.VK_O:
		return "O";
	case KeyEvent.VK_P:
		return "P";
	case KeyEvent.VK_A:
		return "A";
	case KeyEvent.VK_S:
		return "S";
	case KeyEvent.VK_D:
		return "D";
	case KeyEvent.VK_F:
		return "F";
	case KeyEvent.VK_G:
		return "G";
	case KeyEvent.VK_H:
		return "H";
	case KeyEvent.VK_J:
		return "J";
	case KeyEvent.VK_K:
		return "K";
	case KeyEvent.VK_L:
		return "L";
	case KeyEvent.VK_Z:
		return "Z";
	case KeyEvent.VK_X:
		return "X";
	case KeyEvent.VK_C:
		return "C";
	case KeyEvent.VK_V:
		return "V";
	case KeyEvent.VK_B:
		return "B";
	case KeyEvent.VK_N:
		return "N";
	case KeyEvent.VK_M:
		return "M";
	default:
		return "";
	}
}
 
Example 14
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getLowerCaseAlphaChar(int code) {
	switch (code) {
	case KeyEvent.VK_Q:
		return "q";
	case KeyEvent.VK_W:
		return "w";
	case KeyEvent.VK_E:
		return "e";
	case KeyEvent.VK_R:
		return "r";
	case KeyEvent.VK_T:
		return "t";
	case KeyEvent.VK_Y:
		return "y";
	case KeyEvent.VK_U:
		return "u";
	case KeyEvent.VK_I:
		return "i";
	case KeyEvent.VK_O:
		return "o";
	case KeyEvent.VK_P:
		return "p";
	case KeyEvent.VK_A:
		return "a";
	case KeyEvent.VK_S:
		return "s";
	case KeyEvent.VK_D:
		return "d";
	case KeyEvent.VK_F:
		return "f";
	case KeyEvent.VK_G:
		return "g";
	case KeyEvent.VK_H:
		return "h";
	case KeyEvent.VK_J:
		return "j";
	case KeyEvent.VK_K:
		return "k";
	case KeyEvent.VK_L:
		return "l";
	case KeyEvent.VK_Z:
		return "z";
	case KeyEvent.VK_X:
		return "x";
	case KeyEvent.VK_C:
		return "c";
	case KeyEvent.VK_V:
		return "v";
	case KeyEvent.VK_B:
		return "b";
	case KeyEvent.VK_N:
		return "n";
	case KeyEvent.VK_M:
		return "m";
	default:
		return "";
	}
}
 
Example 15
Source File: Robot.java    From xnx3 with Apache License 2.0 4 votes vote down vote up
/**
 * 将字符型转换为按键码,可直接使用 {@link #press(int)}调用
 * @param key 字符型文字,包含 0~9 a~z .
 * @return 按键码
 */
public int StringToKey(String key){
	switch (key) {
	case "a":
		return KeyEvent.VK_A;
	case "b":
		return KeyEvent.VK_B;
	case "c":
		return KeyEvent.VK_C;
	case "d":
		return KeyEvent.VK_D;
	case "e":
		return KeyEvent.VK_E;
	case "f":
		return KeyEvent.VK_F;
	case "g":
		return KeyEvent.VK_G;
	case "h":
		return KeyEvent.VK_H;
	case "i":
		return KeyEvent.VK_I;
	case "j":
		return KeyEvent.VK_J;
	case "k":
		return KeyEvent.VK_K;
	case "l":
		return KeyEvent.VK_L;
	case "m":
		return KeyEvent.VK_M;
	case "n":
		return KeyEvent.VK_N;
	case "o":
		return KeyEvent.VK_O;
	case "p":
		return KeyEvent.VK_P;
	case "q":
		return KeyEvent.VK_Q;
	case "r":
		return KeyEvent.VK_R;
	case "s":
		return KeyEvent.VK_S;
	case "t":
		return KeyEvent.VK_T;
	case "u":
		return KeyEvent.VK_U;
	case "v":
		return KeyEvent.VK_V;
	case "w":
		return KeyEvent.VK_W;
	case "x":
		return KeyEvent.VK_X;
	case "y":
		return KeyEvent.VK_Y;
	case "z":
		return KeyEvent.VK_Z;
	case "0":
		return KeyEvent.VK_0;
	case "1":
		return KeyEvent.VK_1;
	case "2":
		return KeyEvent.VK_2;
	case "3":
		return KeyEvent.VK_3;
	case "4":
		return KeyEvent.VK_4;
	case "5":
		return KeyEvent.VK_5;
	case "6":
		return KeyEvent.VK_6;
	case "7":
		return KeyEvent.VK_7;
	case "8":
		return KeyEvent.VK_8;
	case "9":
		return KeyEvent.VK_9;
	case ".":
		return KeyEvent.VK_PERIOD;
	default:
		break;
	}
	
	return 0;
}
 
Example 16
Source File: ExportToGURPSCalculatorCommand.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
private ExportToGURPSCalculatorCommand() {
    super(I18n.Text("Export to GURPS Calculator…"), "ExportToGURPSCalculator", KeyEvent.VK_L);
}
 
Example 17
Source File: SearchAndAnnotatePanel.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public AnnotateAllMatchesAction() {
  super("Ann. all next");
  super.putValue(SHORT_DESCRIPTION, "Annotates all the following matches.");
  super.putValue(MNEMONIC_KEY, KeyEvent.VK_L);
}
 
Example 18
Source File: ExecuteTestAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** creates new ExecuteTestAction instance */
public ExecuteTestAction() {
    super(MENU, MENU, new Action.Shortcut(KeyEvent.CTRL_MASK|KeyEvent.ALT_MASK, KeyEvent.VK_L));
}