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_PAUSE
The following examples show how to use
java.awt.event.KeyEvent#VK_PAUSE .
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: ShortcutAndMenuKeyEventProcessor.java From netbeans with Apache License 2.0 | 4 votes |
public boolean dispatchKeyEvent(KeyEvent ev) { log.fine("dispatchKeyEvent ev: " + ev.paramString() + " source:" + ev.getSource().getClass().getName()); // in some ctx, may need event filtering if (NbKeymap.getContext().length != 0) { // Ignore anything but KeyPressed inside ctx, #67187 if (ev.getID() != KeyEvent.KEY_PRESSED) { ev.consume(); return true; } skipNextTyped = true; Component comp = ev.getComponent(); if (!(comp instanceof JComponent) || ((JComponent)comp).getClientProperty("context-api-aware") == null) { // not context api aware, don't pass subsequent events processShortcut(ev); // ignore processShortcut result, consume everything while in ctx return true; } } if (ev.getID() == KeyEvent.KEY_PRESSED && ev.getModifiers() == (InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK) && (ev.getKeyCode() == KeyEvent.VK_PAUSE || ev.getKeyCode() == KeyEvent.VK_CANCEL) ) { Object source = ev.getSource(); if (source instanceof Component) { Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); System.err.println("*** ShortcutAndMenuKeyEventProcessor: current focus owner = " + focused); // NOI18N } ev.consume(); return true; } // multi-shortcut in middle if (ev.getID() == KeyEvent.KEY_TYPED && skipNextTyped) { ev.consume(); skipNextTyped = false; return true; } if (ev.getID() == KeyEvent.KEY_RELEASED) { skipNextTyped = false; } if (ev.getID() == KeyEvent.KEY_PRESSED) { // decompose to primitive fields to avoid memory profiler confusion (keyEvent keeps source reference) lastKeyChar = ev.getKeyChar(); lastModifiers = ev.getModifiers(); lastSampled = true; } MenuElement[] arr = MenuSelectionManager.defaultManager().getSelectedPath(); if (arr == null || arr.length == 0) { wasPopupDisplayed = false; // Only here for fix #41477: // To be able to catch and dispatch Ctrl+TAB and Ctrl+Shift+Tab // in our own way, it's needed to do as soon as here, because // otherwise Swing will use these keys as focus traversals, which // means that TopComponent which contains focusCycleRoot inside itself // will grab these shortcuts, which is not desirable return KeyboardPopupSwitcher.processShortcut(ev); } if (!wasPopupDisplayed && lastSampled == true && ev.getID() == KeyEvent.KEY_TYPED && lastModifiers == InputEvent.ALT_MASK && ev.getModifiers() == InputEvent.ALT_MASK && lastKeyChar == ev.getKeyChar() ) { wasPopupDisplayed = true; ev.consume(); return true; } wasPopupDisplayed = true; MenuSelectionManager.defaultManager().processKeyEvent(ev); // commented out as #130919 fix - I don't know why this was here, but // it did prevent keyboard functioning in menus in dialogs /*if (!ev.isConsumed() && arr != null && arr.length > 0 && arr[0] instanceof JMenuBar) { ev.setSource(WindowManagerImpl.getInstance().getMainWindow()); }*/ return ev.isConsumed(); }
Example 2
Source File: GOSwingEventConverter.java From settlers-remake with MIT License | 4 votes |
private String getKeyName(KeyEvent e) { String text = KeyEvent.getKeyText(e.getKeyCode()); if (text == null || text.length() != 1) { switch (e.getKeyCode()) { case KeyEvent.VK_LEFT: text = "LEFT"; break; case KeyEvent.VK_RIGHT: text = "RIGHT"; break; case KeyEvent.VK_DOWN: text = "DOWN"; break; case KeyEvent.VK_UP: text = "UP"; break; case KeyEvent.VK_PAUSE: text = "PAUSE"; break; case KeyEvent.VK_F1: text = "F1"; break; case KeyEvent.VK_F2: text = "F2"; break; case KeyEvent.VK_F3: text = "F3"; break; case KeyEvent.VK_F4: text = "F4"; break; case KeyEvent.VK_F5: text = "F5"; break; case KeyEvent.VK_F6: text = "F6"; break; case KeyEvent.VK_F7: text = "F7"; break; case KeyEvent.VK_F8: text = "F8"; break; case KeyEvent.VK_F9: text = "F9"; break; case KeyEvent.VK_F10: text = "F10"; break; case KeyEvent.VK_F11: text = "F11"; break; case KeyEvent.VK_F12: text = "F12"; break; case KeyEvent.VK_PLUS: text = "+"; break; case KeyEvent.VK_MINUS: text = "-"; break; case KeyEvent.VK_DELETE: text = "DELETE"; break; case KeyEvent.VK_SPACE: text = " "; break; case KeyEvent.VK_ESCAPE: text = "ESCAPE"; break; case KeyEvent.VK_BACK_SPACE: text = "BACK_SPACE"; break; case KeyEvent.VK_TAB: text = "TAB"; break; default: text = "" + e.getKeyChar(); } } return text; }