Available Methods
- getKeyCode ( )
- consume ( )
- VK_RIGHT
- VK_UP
- getID ( )
- getKeyChar ( )
- VK_DOWN
- KEY_PRESSED
- VK_ENTER
- VK_LEFT
- KEY_RELEASED
- KEY_TYPED
- VK_UNDEFINED
- VK_ESCAPE
- VK_SPACE
- VK_ALT
- getWhen ( )
- CHAR_UNDEFINED
- VK_A
- VK_BACK_SPACE
- VK_S
- getModifiers ( )
- isControlDown ( )
- VK_CONTROL
- isConsumed ( )
- VK_SHIFT
- VK_DELETE
- VK_W
- VK_SCROLL_LOCK
- getKeyText ( )
- getSource ( )
- VK_TAB
- VK_F10 ( )
- isShiftDown ( )
- VK_CAPS_LOCK
- getKeyModifiersText ( )
- VK_NUM_LOCK
- VK_D
- VK_HOME
- getComponent ( )
- isAltDown ( )
- VK_C
- VK_KANA_LOCK
- VK_R
- VK_META
- VK_MINUS
- CTRL_MASK
- VK_PAGE_UP
- VK_F1 ( )
- VK_B
- VK_PAGE_DOWN
- VK_V
- VK_F12 ( )
- VK_L
- VK_PLUS
- VK_Z
- VK_F2 ( )
- VK_9 ( )
- VK_I
- VK_END
- VK_N
- VK_P
- isActionKey ( )
- VK_8 ( )
- VK_SLASH
- VK_SEMICOLON
- getModifiersEx ( )
- VK_U
- VK_EQUALS
- VK_J
- VK_CONTEXT_MENU
- VK_0 ( )
- VK_F8 ( )
- VK_M
- VK_F7 ( )
- VK_X
- VK_O
- VK_ADD
- VK_H
- VK_5 ( )
- VK_F5 ( )
- VK_F4 ( )
- VK_7 ( )
- VK_K
- VK_UNDERSCORE
- VK_ALT_GRAPH
- VK_F11 ( )
- VK_COMMA
- VK_KP_LEFT
- ALT_MASK
- VK_BACK_SLASH
- VK_DEAD_ACUTE
- VK_DIVIDE
- VK_Q
- VK_E
- VK_3 ( )
- VK_CLOSE_BRACKET
- getExtendedKeyCodeForChar ( )
- VK_WINDOWS
- VK_6 ( )
- VK_PERIOD
- VK_NUMPAD0 ( )
- VK_NUMPAD1 ( )
- VK_INSERT
- isMetaDown ( )
- VK_F3 ( )
- VK_KP_RIGHT
- VK_F6 ( )
- setSource ( )
- VK_NUMPAD4 ( )
- VK_NUMPAD7 ( )
- VK_NUMPAD2 ( )
- SHIFT_MASK
- CTRL_DOWN_MASK
- VK_NUMPAD5 ( )
- VK_NUMPAD9 ( )
- VK_Y
- VK_T
- VK_2 ( )
- ALT_DOWN_MASK
- VK_F9 ( )
- VK_BACK_QUOTE
- VK_F
- VK_KP_UP
- VK_HELP
- VK_KP_DOWN
- VK_1 ( )
- VK_MULTIPLY
- META_MASK
- VK_G
- VK_SUBTRACT
- VK_F13 ( )
- getKeyLocation ( )
- VK_DECIMAL
- VK_COLON
- VK_4 ( )
- VK_PAUSE
- VK_OPEN_BRACKET
- VK_CIRCUMFLEX
- VK_QUOTE
- VK_NUMPAD6 ( )
- VK_CANCEL
- VK_NUMPAD3 ( )
- VK_PRINTSCREEN
- KEY_LOCATION_STANDARD
- VK_GREATER
- VK_DEAD_GRAVE
- VK_ROMAN_CHARACTERS
- VK_DEAD_BREVE
- VK_NUMPAD8 ( )
- VK_F14 ( )
- VK_AT
- VK_CONVERT
- VK_LEFT_PARENTHESIS
- VK_F16 ( )
- VK_F15 ( )
- VK_HALF_WIDTH
- VK_RIGHT_PARENTHESIS
- KEY_LOCATION_NUMPAD
- VK_STOP
- VK_DEAD_VOICED_SOUND
- VK_F21 ( )
- VK_INPUT_METHOD_ON_OFF
- VK_PASTE
- VK_KANJI
- isAltGraphDown ( )
- setKeyChar ( )
- SHIFT_DOWN_MASK
- VK_JAPANESE_HIRAGANA
- VK_DEAD_CEDILLA
- VK_NONCONVERT
- VK_KANA
- KEY_LOCATION_LEFT
- VK_DEAD_DOUBLEACUTE
- VK_DEAD_CIRCUMFLEX
- VK_BRACELEFT
- VK_HIRAGANA
- VK_EXCLAMATION_MARK
Related Classes
- java.io.File
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- javax.swing.JButton
- java.awt.BorderLayout
- javax.swing.JOptionPane
- java.awt.Component
- javax.swing.JScrollPane
- java.awt.event.WindowEvent
- java.awt.Toolkit
- javax.swing.JTextField
- javax.swing.SwingUtilities
- java.awt.event.MouseAdapter
- javax.swing.ImageIcon
- java.awt.Point
- javax.swing.JComponent
- java.awt.event.WindowAdapter
- javax.swing.JCheckBox
Java Code Examples for java.awt.event.KeyEvent#VK_PASTE
The following examples show how to use
java.awt.event.KeyEvent#VK_PASTE .
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: SwingUtilities2.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Returns true if the given event is corrent gesture for * accessing clipboard * * @param ie InputEvent to check */ @SuppressWarnings("deprecation") private static boolean isAccessClipboardGesture(InputEvent ie) { boolean allowedGesture = false; if (ie instanceof KeyEvent) { //we can validate only keyboard gestures KeyEvent ke = (KeyEvent)ie; int keyCode = ke.getKeyCode(); int keyModifiers = ke.getModifiers(); switch(keyCode) { case KeyEvent.VK_C: case KeyEvent.VK_V: case KeyEvent.VK_X: allowedGesture = (keyModifiers == InputEvent.CTRL_MASK); break; case KeyEvent.VK_INSERT: allowedGesture = (keyModifiers == InputEvent.CTRL_MASK || keyModifiers == InputEvent.SHIFT_MASK); break; case KeyEvent.VK_COPY: case KeyEvent.VK_PASTE: case KeyEvent.VK_CUT: allowedGesture = true; break; case KeyEvent.VK_DELETE: allowedGesture = ( keyModifiers == InputEvent.SHIFT_MASK); break; } } return allowedGesture; }
Example 2
Source File: TextFieldCaret.java From Logisim with GNU General Public License v3.0 | 4 votes |
@Override public void keyPressed(KeyEvent e) { int ign = InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.META_DOWN_MASK; if ((e.getModifiersEx() & ign) != 0) return; switch (e.getKeyCode()) { case KeyEvent.VK_LEFT: case KeyEvent.VK_KP_LEFT: if (pos > 0) --pos; break; case KeyEvent.VK_RIGHT: case KeyEvent.VK_KP_RIGHT: if (pos < curText.length()) ++pos; break; case KeyEvent.VK_HOME: pos = 0; break; case KeyEvent.VK_END: pos = curText.length(); break; case KeyEvent.VK_ESCAPE: case KeyEvent.VK_CANCEL: cancelEditing(); break; case KeyEvent.VK_CLEAR: curText = ""; pos = 0; break; case KeyEvent.VK_ENTER: stopEditing(); break; case KeyEvent.VK_BACK_SPACE: if (pos > 0) { curText = curText.substring(0, pos - 1) + curText.substring(pos); --pos; field.setText(curText); } break; case KeyEvent.VK_DELETE: if (pos < curText.length()) { curText = curText.substring(0, pos) + curText.substring(pos + 1); field.setText(curText); } break; case KeyEvent.VK_INSERT: case KeyEvent.VK_COPY: case KeyEvent.VK_CUT: case KeyEvent.VK_PASTE: // TODO: enhance label editing break; default: ; // ignore } }