Suspend a keyReleased event

How i can suspend a keyReleased event?
I try with:
public void keyReleased (KeyEvent e) {
      while(myCondition) { // nothing. code of the my main Thread puts slowww }
       // process the keyReleased event
}When exit of the while the speed are normal.
...

Sorry, read:
"I need to suspend keyPressed until JUMP finish, then keyReleased continue, next sentence clear the HashMap entry."
instead of:
"I need to suspend keyPressed until JUMP finish, then keyPressed continue, next sentence clear the HashMap entry."
Any suggested idea is to use:
public class keyboard extends KeyListener {
         private Frame frame; // where main Thread is locale
         private HashMap keymap  = new HasMap();
         public keyboard(Frame frame) {
                this.frame=frame;
                frame.addKeyListener(this);
         public void keyReleased() {
                   if(frame.JUMP) return;
                  // code                
          public void clearHashMap() {
               // clear HashMap
public class frame() {
          // call it 40 FPS
          public void doAnim {
               // complex code to post it
               When jump has finish keyboard.clearHashMap();
}Once JUMP has finish clear ALL the HashMap.

Similar Messages

  • [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

    Hi Archers :)
    First post, sorry if not in the right section.
    I have a quite anoying bug. I bought a no name laptop, imported by Textorm, model M116 SU7300, same model as this one (http://www.textorm.com/pc-portable/pc-p … 22%5D.html)
    On the keyboard, the '<' and '>' symbols are mapped on "fn+W" and "fn+MAJ+W".
    Everything works fine in a TTY console. All others fn-KEY are working well.
    The problem is with a Xorg environment : when pressing fn+W or fn+MAJ+W, it seems that the release key is never triggered, acting like if I was pressing the key in continue.
    When pressing another key, the crazy '<' input stop, but then, fn+W won't works again... until I trigger a press/release event with 'acpi_fakekey 86'.
    Then, same scenario.
    I booted a live Archbang,  same result (well, I wasn't very surprised), and a live Sabayon... same result.
    Using xev, I can see that when pressing/releasing fn+W, the KeyReleased event is never triggered. I can provide a log if needed.
    So it seems related to the Xorg driver....
    I tryied to use the kbd driver by adding an xorg.conf
    Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "CoreKeyboard"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "fr" # "fr-oss" pour Feisty et +
    Option "XkbVariant" "latin9"
    EndSection
    Section "ServerFlags"
    Option "AutoAddDevices" "Off"
    EndSection
    I can confirm that the kbd driver was in use with Xorg log :
    [ 900.371] (II) LoadModule: "kbd"
    [ 900.371] (II) Loading /usr/lib/xorg/modules/input/kbd_drv.so
    [ 900.371] (II) Module kbd: vendor="X.Org Foundation"
    [ 900.371] compiled for 1.14.0, module version = 1.7.0
    [ 900.371] Module class: X.Org XInput Driver
    [ 900.371] ABI class: X.Org XInput driver, version 19.1
    [ 900.780] (II) Using input driver 'kbd' for 'Generic Keyboard'
    [ 900.780] (**) Option "CoreKeyboard" "on"
    [ 900.780] (**) Generic Keyboard: always reports core events
    [ 900.780] (**) Generic Keyboard: always reports core events
    [ 900.780] (**) Option "Protocol" "standard"
    [ 900.780] (**) Option "XkbRules" "xorg"
    [ 900.780] (**) Option "XkbModel" "pc105"
    [ 900.780] (**) Option "XkbLayout" "fr"
    [ 900.780] (**) Option "XkbVariant" "latin9"
    [ 900.780] (II) XINPUT: Adding extended input device "Generic Keyboard" (type: KEYBOARD, id 6)
    ... no luck. Same comportement.
    I tryed the xorg-input-evdev git version, no luck. (But if I understand, xorg-input-evdev use kbd as underlying driver?)
    I also tryed xorg-server-dev 1.14.99.1-1
    So for now, I use a ugly hack : I mapped "W-W" and "S-W-W" in my openbox rc.xml to execute "acpi_fakekey 86". Nearly working all the time.
    I know this isn't directly related to Arch, but if someone has any pointers... I take any ideas.
    Thanks in advance!
    PS :
    xorg-server 1.14.1-1
    xf86-input-evdev 2.8.0-1
    Last edited by jc.saaddupuy (2013-05-28 18:28:05)

    Wow thanks!
    I confirm that this is working.
    Thanks to your infos, I investigate the udev stuff.
    You will have to know the vendor and product name of your machine :
    cat /sys/class/dmi/id/{sys_vendor,product_name}
    Thats the strings your udev rule have to match in ENV{DMI_VENDOR} and ATTR{[dmi/id]product_name}.
    For me, both was empty, so I use a wildcard :
    ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*"
    Then, you'll have to specify which codes needs to trigger a key release (sames as found with keymap -i)
    Add a file in /usr/lib/udev/keymaps/force-release/  whith the hex values (one per line)
    I named mine 'textorm'
    /echo 0x56 > /usr/lib/udev/keymaps/force-release/textorm
    And add it in the RUN of your udev rule (not the full file name):
    ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*", RUN+="keyboard-force-release.sh $devpath textorm"
    Knowing your serio ( /sys/bus/serio/devices/serio0), you can test the keyboard-force-release.sh script (the serio parameter HAVE TO NOT begin with /sys/)
    /usr/lib/udev/keyboard-force-release.sh bus/serio/devices/serio0 textorm
    You can then check the /sys/bus/serio/devices/serio0/force_release content.
    Works like a charm :)

  • ValueChanged- and keyReleased-Events in JTree

    Hello,
    Suppose I have Items in a JTree. Any time the selected item changes, heavy work has to be done to get the details of the node and present it to the user.
    Suppose further the user uses the arrow-keys to scroll through the list an he holds down the key. I do get many calls to my Listeners valueChanged(TreeSelectionEvent event), but I am interested just in the last event, in order to avoid all the heavy work. How can this be done?
    I tried the following, but I do get a keyReleased-Event at any new selection. (Maybe because a nested component of the JTree feels like I had released the arrow-key. Is this a bug?):
    private class NodeSelectionEventHandler implements KeyListener, TreeSelectionListener {
    private boolean forwardEvents = true;
    private EventObject lastEvent;
    public void keyTyped(KeyEvent e) {
    public void keyPressed(KeyEvent e) {
    forwardEvents = false;
    public void keyReleased(KeyEvent e) {
    //System.out.println(e.getComponent());
    // Leider bekomme ich nach jeder auswahl mit Cursortaste auch einen
    // keyReleased-Event, obwohl die Taste immer noch gedrueckt ist.
    forwardEvents = true;
    if (lastEvent != null) {
    lastEvent = null;
    fireNodeSelectionChanged();
    //System.out.println("Last Selection forwarded");
    public void valueChanged(TreeSelectionEvent event) {
    // there is no event.getValueIsAdjusting() in JDK1.3
    handelEvent(event);
    private void handelEvent(EventObject event) {
    //Thread.dumpStack();
    if (forwardEvents) {
    lastEvent = null;
    fireNodeSelectionChanged();
    //System.out.println("Selection forwarded");
    else {
    lastEvent = event;
    //System.out.println("Selection eaten");

    I have a JTree from which I generate classes on selection.
    To ensure only one event is fired I install two listeners.
    I install a mouse listener and capture an event when the mouse is clicked, and I install a key listener and only catch the enter key being pressed as follows:
    tree.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(MouseEvent e) {
              showFunction();
    tree.addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyReleased(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ENTER) {
    showFunction();
    This means something happens only if a user clicks on the node with the mouse or selects the node and presses the enter button. I have used this as a general standard throughout my application and it works on all platforms.
    Hope this helps

  • "real" keyreleased events?

    I have searched high and low for this answer.
    Does anyone know how to catch "real" key pressed or key released events?
    I am trying to write an app, that has a fastforward and rewind action. I need to know how long they have held down the button.
    Java for some reason, enlighten me please, sends the key press and key released any type a key is pressed...the names are quite misleading to me.
    I have tried many different things and nothing i have tried works. I am so close to finishing the alpha stage of my app, and i ran into this wall.
    Greatly appreciated for an answer,
    shane

    Either i am just not getting it again....or something else here is the code i wrote.
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame {
        JEditorPane editMain = new JEditorPane();
        long l=0;
        public Test() throws Exception{
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JButton b=new JButton("Test");
            this.getContentPane().add(b);
            b.addKeyListener(new KeyAdapter() {
                  public void keyTyped(KeyEvent e) {
                  public void keyPressed(KeyEvent e) {
                      if (l==0) {
                          l = System.currentTimeMillis();
                        System.out.println("key pressed");
                      e.consume();
                  public void keyReleased(KeyEvent e) {
                      l=System.currentTimeMillis()-l;
                      System.out.println("press time released="+l);
                      l=0;
                      e.consume();
        public static void main(String args[]) throws Exception {
            Test gI = new Test();
            gI.setSize(420, 380);
            gI.setLocationRelativeTo(null);
            gI.setVisible(true);
    }There is the code above i wrote. Now this still does not work becuase there is no way to tell when it was released. Here is the output from me holding down one key for a couple of like two seconds, and then released.
    Maybe yall can see what i talking about now. Here
    key pressed
    press time released=500
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=33
    key pressed
    press time released=34
    key pressed
    press time released=32
    key pressed
    press time released=28
    key pressed
    press time released=30
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=33
    key pressed
    press time released=34
    key pressed
    press time released=33
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=29
    key pressed
    press time released=29
    key pressed
    press time released=34
    key pressed
    press time released=34
    key pressed
    press time released=24
    Process Test finishedAm I wrong here, but wouldnt you expect just 2 println's here.
    Even if i put some delay on this, or try to consume. I think this is a linux/java problem. But i am kinda obsessed now, I want to know a work around.

  • KeyReleased event problems

    Hi everybody,
    i have a JTable and what I want to is that when the user type something in the TextField the table will show the names of the company that start with the letter that the user typed. But the problem is that each time the user type the event executes 2 times, this is the code:
    private void txt_searchCompanyKeyReleased(java.awt.event.KeyEvent evt) {
    TableModel model = jt_Company.getModel();
    ArrayList<String[]> dataArray = new ArrayList<String[]>();
    String[] data = new String[ jt_Company.getRowCount() ];
    String s = txt_searchCompany.getText();
    System.out.println("Cantidad de filas: " + jt_Company.getRowCount()+ "\nCantidad de col: " + jt_Company.getColumnCount());
    for(int i = 0; i < jt_Company.getRowCount(); i++)
       for(int j = 0; j < model.getColumnCount(); j++)
           if(model.getValueAt(i, 1).toString().startsWith(s) == true)
             data = model.getValueAt(i, j).toString();
             dataArray.add(data);
              System.out.println(" " + data[0] + "Tamano de ArrayList: " + data.  length);
    jt_Company.setModel(new Business.CompanyTable(dataArray));
    }//End of the method
    the method compares very well the string and the name of the companies in each row, but as mention before the method do it 2 times that means that the string array will the double of rows.
    How can I do to make the event execute only one time
    Thanks a lot.......

    Hi,
    KeyListener is not probably a good idea for you. You should use DocumentListener. for Example:
    jTextFieldIP.getDocument().addDocumentListener(new DocumentListener()
       public void changeUpdate(DocumentEvent e){}
       public void insertUpdate(DocumentEvent e)
           try
               jListCode.setSelectedIndex(Integer.parseInt(jTextFieldIP.getText()));
            catch(NumberFormatException ne)
                JOptionPane.showMessageDialog(null, "Only numbers in this field please.");
       public void removeUpdate(DocumentEvent e)
           insertUpdate(e);
    } );

  • KeyReleased Event

    Hi everybody,
    i have a JTable and what I want to is that when the user type something in the TextField the table will show the names of the company that start with the letter that the user typed. But the problem is that each time the user type the event executes 2 times, this is the code:
    private void txt_searchCompanyKeyReleased(java.awt.event.KeyEvent evt) {
    TableModel model = jt_Company.getModel();
    ArrayList<String[]> dataArray = new ArrayList<String[]>();
    String[] data = new String[ jt_Company.getRowCount() ];
    String s = txt_searchCompany.getText();
    System.out.println("Cantidad de filas: " + jt_Company.getRowCount()+ "\nCantidad de col: " + jt_Company.getColumnCount());
    for(int i = 0; i < jt_Company.getRowCount(); i++)
       for(int j = 0; j < model.getColumnCount(); j++)
           if(model.getValueAt(i, 1).toString().startsWith(s) == true)
             data = model.getValueAt(i, j).toString();
             dataArray.add(data);
              System.out.println(" " + data[0] + "Tamano de ArrayList: " + data.  length);
    jt_Company.setModel(new Business.CompanyTable(dataArray));
    }//End of the methodthe method compares very well the string and the name of the companies in each row, but as mention before the method does it 2 times that means that the string array will the double of rows.
    How can I do to make the event execute only one time
    Thanks a lot.......

    Hi camickr, i tried what you said and It works well, but now i am traying to do another thing.
    Look, i want that the textfield remove the last character when the user type one of this character: ( ' / * % ? = > < etc...)and this is the code:
    class MyDocumentListener implements DocumentListener {
        /** Creates a new instance of MyDocumentListener */
        public MyDocumentListener() {
        public void insertUpdate(DocumentEvent e) {
          updateLog(e);
        public void removeUpdate(DocumentEvent e) {
          updateLog(e);
        public void changedUpdate(DocumentEvent e) {
        //Plain text components don't fire these events.
        public void updateLog(DocumentEvent e) {
           int i = e.getDocument().getLength();
           String name = " ";
           try{
                name = e.getDocument().getText(i-1, 1);
                if(restriction.restrictionSearchBy(name) == true)
                   JOptionPane.showMessageDialog(null, "Hola" + name);
                   txt_searchCompany.getDocument().remove(i-1, 1);
                   e.getDocument().remove(i-1, 1);// I tried this and did not work also
                else{
           catch(javax.swing.text.BadLocationException b){}
    }but i got this exception when i run it:
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Attempt to mutate in notification
    at javax.swing.text.AbstractDocument.writeLock(AbstractDocument.java:1343)
    at javax.swing.text.AbstractDocument.remove(AbstractDocument.java:569)
    at Client.MDIFrame$MyDocumentListener.updateLog(MDIFrame.java:867)
    at Client.MDIFrame$MyDocumentListener.insertUpdate(MDIFrame.java:847)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:184)
    at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:754)
    at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:711)
    at javax.swing.text.PlainDocument.insertString(PlainDocument.java:114)
    at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:673)
    at javax.swing.text.JTextComponent.replaceSelection(JTextComponent.java:1099)
    at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(DefaultEditorKit.java:839)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2798)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
    at java.awt.Component.processEvent(Component.java:5265)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    what can i do the remove it.
    Thanks a lot....

  • Suspending JMS event generator

    Hi,
    How do I suspend a jms event dynamically?
    I know that this can be done with WLI Admin Console but is there another way to do this without user intervention?
    Help appreciated.

    Hello,
    event generators are in most cases EJBs (the HTTP event generator may be the only exeption).
    Suspending is actually equal to undeploying.
    I do not know, if you can use the event generator MBeans, but you can always use the weblogic.Admin command to undeploy/redeploy a JMS event generator.
    -Kai

  • Script to suspend/resume event generators in WLI 8.1

    Hi,
    Is there any script to suspend/resume the event generators in WLI 8.1.

    Hi,
    Is there any script to suspend/resume the event generators in WLI 8.1.

  • Listening key events

    Hello there,
    I am trying to get the information of the key pressed on the keyboard. Following code works only for characters not for the arrow keys, alt, shift, F1 and etc...
    Can you tell me what should I do?
    Thanks.
    Berk Can Celebisoy
    class MyKeyEvents implements KeyListener
    public void keyTyped(KeyEvent e) {
    System.out.println(e.getKeyChar());
    public void keyReleased(KeyEvent e) {
    public void keyPressed(KeyEvent e) {
    }

    The KeyTyped event is only generated for displayable characters. KeyPressed/KeyReleased events are generated for all key strokes.
    Read the KeyEvent API for more information.

  • Trouble with keyboad events and thead

    hi ,
    i am havin a poblem with keyboad events and thead.
    i have used t.start() in the keyreleased event but the thread runs only for 1st keyreleased event then when i again release any key it gives me a run time error as follows.
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalThreadStateException
    at java.lang.Thread.start(Unknown Source)
    at snake.key(snake.java:67)
    at snake.keyReleased(snake.java:34)
    at java.awt.Component.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour
    ce)
    please help me out .

    You might want to reschedule a timer task instead of trying to start a thread again. Or you could modify your thread class in a way that you
    - check whether it's already running
    - if so, stop it
    - initialize the countdown or whatever you do
    - start it

  • JComboBox Event Handling

    Editable JComboBox (combo1.setEditable(true)) is not adhering to KeyEvents such as keyTyped() and keyReleased() events.
    How can I make a "Editable" JComboBox to adhere KeyEvents.

    a comboBox is made up of many components.
    when editable there is a JTextField
    you need to get the textfield to add the keylistener
    combo.getEditor().getEditorComponent().addKeyListener(new KeyAdapter()
    other times you may need to cast it
    ((JTextField)combo.getEditor().getEditorComponent()).someMethod()

  • KeyTyped Event: funny behaviour

    This should be a very simple question... but I am stuck with it.
    I want to implement the usual feature of enabling a button only if a text field is not empty. I suppose you all have seen this before.
    I am catching the KeyTyped event and in the event handler I am checking for the length of the text. This is the code inside the handler:
    String txt=myTextField.getText();
    myButton.setEnabled(txt.length()>0);
    So yes, it works, but with a funny behaviour: the button is enabled only after the second keystroke, that is, when the length of the text is >=2 and not >0. A quick explanation is that my event handler is being called before the event handler of the textfield itself so at that moment the text is still empty. But when pressing the "backspace" key... it works fine, so the theory is wrong!!
    My workaround is to catch the KeyReleased event... but visual effect is not so satisfactory, and anyway, why is this happening?
    And what is the "official" way of implementing this trick?
    Thanks in advance,
    Luis.
    (P.S.: I am using a JTextField and a JButton, and have tested this with JDK 1.2 and 1.4 with the same results.)

    You'd want to do something like this:
    JTextField watchedField = new JTextField();
    // construct the action
    FieldWatcherAction watcher = new FieldWatcherAction( watchedField );
    // make a button with the action
    JButton b = new JButton( watcher );
    // add a button to a toolbar with the action
    jtoolBar.add( watcher );
    // etc...
    class FieldWatcherAction extends AbstractAction implements DocumentListener
      JTextField  field;
      public FieldWatcherAction( JTextField f )
        super( "", someIcon );
        setEnabled( false );
        field = f;
        field.getDocument().addDocumentListener( this );
      protected void updateState()
        setEnabled( field.getDocument().getLength() > 0 );
      public void insertUpdate( DocumentEvent evt )
        updateState();
      public void removeUpdate( DocumentEvent evt )
        updateState().;
      public void changedUpdate( DocumentEvent evt )
        updateState();
    }The action would need to be fleshed out more, obviously. You'd probably want to add text for a label ( empty string in super call in constructor ), define the icon ( second arg in super call ). You can also set tooltip text and other things. All of this can be changed by editing various properties of the action. Relevant constants would be:
    javax.swing.Action.ACCELERATOR_KEY  // key accelerator for JMenuItems
    javax.swing.Action.MNEMONIC_KEY // mnemonic key for JMenuItems
    javax.swing.Action.NAME // JButton text or JMenuItem text
    javax.swing.Action.SHORT_DESCRIPTION // Tooltip text
    javax.swing.Action.SMALL_ICON // image icon for JButton, JMenuItem and JToolBar buttons.

  • [SOLVED][Toshiba Laptop] Volume Wheel never stops generating events

    I have this volume wheel on my laptop which I like to use to control the volume of the audio on my laptop. However I run into a problem:
    The Good  => Using xev I verified that It does generate keypress and keyrelease events (two different ones for either up or down). I would still have to remap those to XF86VolumeLower and such...
    The Bad => Once I turn the wheel  I keep getting keypress/keyrelease events continously even after I've stopped turning it...
    The Ugly = > this makes it completely not usable.
    Anyone seen this problem before? I googled around, most people seemed to have a problem getting events from volume wheels...
    Edit:
    Sorry for editing such an old post. This got fixed in udev-159-1.
    Last edited by GogglesGuy (2010-07-07 17:55:30)

    I'm still having this issue running the latest kernel and xorg. Since the event seems to be reported by xorg, would this most likely be a xorg bug or misconfiguration (and such should I report it as a bug to xorg)?

  • [SOLVED] PgUp/PgDown Improperly Spawn Two Keyboard Events

    After doing an upgrade (pacman -Syu), I can no longer use the following keys on my keyboard without unappreciated consequences:
    - PgUp
    - PgDown
    - now, apparently, the Left arrow
    When I use xev, I get two separate events for every one real keyboard event, with two keycodes.
    For example, this is what happens when I press PgUp:
    KeyPress event, serial 24, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850204, (679,556), root:(680,571),
    state 0x0, keycode 112 (keysym 0xffaf, KP_Divide), same_screen YES,
    XLookupString gives 1 bytes: (2f) "/"
    XmbLookupString gives 1 bytes: (2f) "/"
    XFilterEvent returns: False
    KeyPress event, serial 24, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850204, (679,556), root:(680,571),
    state 0x0, keycode 99 (keysym 0xff55, Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False
    MappingNotify event, serial 27, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248
    KeyRelease event, serial 27, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850306, (679,556), root:(680,571),
    state 0x0, keycode 112 (keysym 0xffaf, KP_Divide), same_screen YES,
    XLookupString gives 1 bytes: (2f) "/"
    XFilterEvent returns: False
    MappingNotify event, serial 27, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248
    KeyRelease event, serial 27, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850306, (679,556), root:(680,571),
    state 0x0, keycode 99 (keysym 0xff55, Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
    I've checked xmodmap -pke, but I have no idea what it means:
    keycode 99 = Prior NoSymbol Prior
    keycode 112 = KP_Divide XF86_Ungrab KP_Divide XF86_Ungrab
    Any help would be appreciated. Needless to say, this is pretty annoying when I'm trying to edit code and it searches my document instead of scrolling up, or capitalizes words (some vim feature I had previously never known about, and will most likely never use).
    Last edited by secretrobotron (2010-06-24 15:09:05)

    I'm pretty sure I'm using the latest xorg. I installed a fresh version of arch a couple months ago.
    My xorg.conf has about six lines concerning keyboards, most of which are
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "keyboard"
    Option "XkbLayout" "us"
    EndSection
    and the other being
    InputDevice "Keyboard0"
    in the ServerLayout section.
    Is there a newer way to do this? Perhaps omitting it altogether?
    I'm using xmonad, and I checked my keybindings in xmonad.hs to see if I had anything hilarious. Alas, I found nothing.

  • Xev/xmodmap only working part of the time [resolved]

    Ok guys, maybe its just my mind playing tricks on me at 1am, but...
    I bought a new laptop. Been trying to get it setup (I even made a wiki page for it in hardware->laptops), and tonight I tackled accelerated 3D, suspend to ram, and function keys (multimedia keys). Which brings me to this post...
    The nice, easy way of setting it up through XFCE4 or keytouch wasn't recognizing all of my keys, so I turned to xmodmap.
    First off, the kernel isn't recognizing all of them. No biggie, I figure we'll play around with evdev and scripting later.
    So ... the ones that do work... well they're producing keycodes in xev! Great!
    Made my xmodmap file
    Ran /usr/bin/xmodmap $HOME/.Xmodmap
    Voila! xev is now showing me keysyms! On to setting them up through XFCE, right?
    Wrong.
    I decided to clean up a bit, and restarted X just for the heck of it.
    Now, my xev is not producing keysyms. Not even showing me keyCODES anymore.
    Where before it was printing your normal output, similar to
    KeyRelease event, serial 31, synthetic NO, window 0x2a00001,
    root 0x87, subw 0x0, time 2557948, (314,172), root:(945,537),
    state 0x50, keycode 174 (keysym 0x0, same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
    (before xmodmap it was null, after it showed the keysym as well) (i just hit a letter and copied/modified this, its not EXACTLY right, since now everything is screwed up)
    now it is showing me
    KeymapNotify event, serial 31, synthetic NO, window 0x0,
    keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    FocusOut event, serial 31, synthetic NO, window 0x2a00001,
    mode NotifyGrab, detail NotifyAncestor
    FocusIn event, serial 31, synthetic NO, window 0x2a00001,
    mode NotifyUngrab, detail NotifyAncestor
    for the same keys.
    This happened the other day, and I just rebooted a few times and it went away. Came right back tonight though.
    I'm not really sure what to do with this one.
    Ideas?
    Last edited by drewbug01 (2008-02-02 08:28:58)

    Hello there,
    It may be that these keys are generating scan codes that X does not translate into key codes. If X doesn't get the key codes, it cannot do any type of key mapping with xmodmap. I had a similar problem with my Dell Inspiron 9300. Certain keys did not get translated by X. To solve this problem I did the following:
    1. Figure out the scan codes for the keys that do not generate X key codes. There is a console program around that lets you do this, but I can't remember it for the life of me. Surely if you google you will find it. I think I recall finding it in an article about setting up these extra keys on Dell laptops, but I'm not sure.
    2. Use setkeycodes to map these scan codes to key codes that X can use. In my case, I added the following to my rc.local file to always map the scan codes on boot:
    # Map the Fn+F1 (Hibernate) key
    setkeycodes e00a 123
    # Map the Fn+F3 (battery) key
    setkeycodes e007 120
    3. Use xmodmap to map these key codes to a key symbol you can use.
    4. Use xbindkeys (or whatever the XFCE equivalent is) to map these keys to your desired action.
    I hope this gets you pointed in the right direction. Good luck.
    jay

Maybe you are looking for

  • My mac mini is running very slow all of a sudden, how can i restore it's speed?

    my mac mini is running very slow all of a sudden, how can i restore it's speed?

  • HELP. My brother is being charged for broadband. h...

    Can someone please help my brother is being charged for bt broadband that he doesn't have after being charged £125 installation fee for a bt man to sit in his van for an hour and not do a thing. After numerous phone calls to resolve this he asked me

  • C form In FI

    hi all can any buddy tell me what is  c form in SAP FI? and which are tables releted to it? if it is help full full poit Message was edited by:         paresh patel

  • ERROR 101 PROBLEM

    Error 101 (problem extracting the installer): Creative Suite 6 Master Collection Trial This question is Not Answered. 21-May-2012 19:26 #trial_download #creative_suite_6    I have 400 gb of free space. 32 gb of ram.Im using Win7 64bit SP1. Have downl

  • Incorporating Active D-lighting in Lightroom or Bridge?

    I would like to have the capability of using the Nikon 800 Active D-Lighting when I want it. My organizing and basic (gross) adjustments happen in Lightroom 5.3.  Lightroom, and as near as I can find, NO Adobe products (Lightroom, Bridge, Photoshop)