[SOLVED]openbox key binding hell

hello everyone I'm having 2 issue setting up new key bindings and I hope someone here can help me I want it to add W-f binding  to open my file manager of choice(pcmanfm) below I will list the two issue and post my rc.xml and all the out put from xev for the f key an the output of xmodmap -pm
issue #1) when I add a key with obkey the bind I add works but all the others openbox key binds stop working here I'm at a lost after trying it a few times and getting the same result I decide to just edit the xml file here where the second issue begins
issue #2) when edited the rc.xml to add the key bind I want it I did exactly as the wiki sead but it didn't work so I start looking around and and found out that I can pass the hex value for the key converting the keycode that I get form xev output below
KeyRelease event, serial 41, synthetic NO, window 0x1a00001,
root 0xac, subw 0x0, time 1106315, (109,-274), root:(897,143),
state 0x0, keycode 41 (keysym 0x66, f), same_screen YES,
XLookupString gives 1 bytes: (66) "f"
XFilterEvent returns: False
after doing that seeing that it didn't work ether I found out about the "default" bind the keyboard below is the output
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
as I read in one of the forum post in the cruchbnag page the mod4 is the for the window key or super
so I cahnge the W key on my binding for Super_L and that didn't work ether a this point i'm at a lost of what to do or how to fix it blow is the keyboard part of my rc.xml
<keyboard>
<chainQuitKey>C-g</chainQuitKey>
<!-- Keybindings for desktop switching -->
<keybind key="C-A-Left">
<action name="GoToDesktop">
<to>left</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Right">
<action name="GoToDesktop">
<to>right</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Up">
<action name="GoToDesktop">
<to>up</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Down">
<action name="GoToDesktop">
<to>down</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Left">
<action name="SendToDesktop">
<to>left</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Right">
<action name="SendToDesktop">
<to>right</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Up">
<action name="SendToDesktop">
<to>up</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Down">
<action name="SendToDesktop">
<to>down</to>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="W-F1">
<action name="GoToDesktop">
<to>1</to>
</action>
</keybind>
<keybind key="W-F2">
<action name="GoToDesktop">
<to>2</to>
</action>
</keybind>
<keybind key="W-F3">
<action name="GoToDesktop">
<to>3</to>
</action>
</keybind>
<keybind key="W-F4">
<action name="GoToDesktop">
<to>4</to>
</action>
</keybind>
<keybind key="W-d">
<action name="ToggleShowDesktop"/>
</keybind>
<!-- Keybindings for windows -->
<keybind key="A-F4">
<action name="Close"/>
</keybind>
<keybind key="A-Escape">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</keybind>
<keybind key="A-space">
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</keybind>
<!-- Keybindings for window switching -->
<keybind key="A-Tab">
<action name="NextWindow">
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<keybind key="A-S-Tab">
<action name="PreviousWindow">
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<keybind key="C-A-Tab">
<action name="NextWindow">
<panels>yes</panels>
<desktop>yes</desktop>
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<!-- Keybindings for window switching with the arrow keys -->
<keybind key="W-S-Right">
<action name="DirectionalCycleWindows">
<direction>right</direction>
</action>
</keybind>
<keybind key="W-S-Left">
<action name="DirectionalCycleWindows">
<direction>left</direction>
</action>
</keybind>
<keybind key="W-S-Up">
<action name="DirectionalCycleWindows">
<direction>up</direction>
</action>
</keybind>
<keybind key="W-S-Down">
<action name="DirectionalCycleWindows">
<direction>down</direction>
</action>
</keybind>
<!-- Keybindings for running applications -->
<keybind key="W-e">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Konqueror</name>
</startupnotify>
<command>kfmclient openProfile filemanagement</command>
</action>
</keybind>
<keybind key="Super_L-0x29">
<action name="Execute">
<commnad>pcmanfm</commnad>
</action>
</keybind>
</keyboard>
the last is the is the one I add it I use both the Super_L and the hex valu of the f key to see if will work but it doesn't also as long I add them by hand all the defaults key bind keep working the second i use obkey they stop working as mention in issue 1
Last edited by gozes (2012-01-01 06:27:00)

You have a misspelling, twice on the same line: commnad should be command.
If that doesn't fix it, try using a full path:
<!-- pcmanfm -->
<keybind key="W-F">
<action name="Execute">
<command>/usr/bin/pcmanfm</command>
</action>
</keybind>

Similar Messages

  • Why does one openbox key binding break others?

    For some reason, using one of my custom key bindings for openbox breaks some others.  Here's the whole rc.xml file: http://paste.pocoo.org/show/498056/ and the part where the key binding is set:
    <keybind key="XF86TouchpadToggle"><!-- Line 348 -->
    <action name="Execute">
    <startupnotify>
    <enabled>false</enabled>
    </startupnotify>
    <command>/home/user/tpad</command>
    </action>
    </keybind>
    /home/user/tpad:
    #!/bin/bash
    if [[ $1 == "on" ]]
    then echo "turning on touchpad"
    exec synclient touchpadoff=0
    elif [[ $1 == "off" ]]
    then echo "turning off touchpad"
    exec synclient touchpadoff=1
    else
    if (($(synclient | grep TouchpadOff | tail -c 2)==0))
    then echo "turning off touchpad"
    exec synclient touchpadoff=1
    else
    echo "turning on touchpad"
    exec synclient touchpadoff=0
    fi
    fi
    After I press Fn-F3 ("XF86TouchPadToggle"), the following key bindings (all set in rc.xml) are broken: XF86AudioLowerVolume, XF86Display, XF86TouchPadToggle (that's right, it breaks itself).  I've tested this several times.  These keys work when I've just started openbox, but as soon as I press XF86TouchPadToggle, they stop working.
    Does anyone have any idea why, and what can be done to fix it?
    Running the script with the same command as in rc.xml does -not- have the same effect.  Pressing the key with the quoted section from rc.xml commented out does -not- have the same effect.

    You have a misspelling, twice on the same line: commnad should be command.
    If that doesn't fix it, try using a full path:
    <!-- pcmanfm -->
    <keybind key="W-F">
    <action name="Execute">
    <command>/usr/bin/pcmanfm</command>
    </action>
    </keybind>

  • [SOLVED] Looking for a terminal command or key binding to exit Openbox

    I've searched the forums and googled, but I haven't been able to find the answer.  I'm sure I've missed it somewhere...
    I start my openbox session with 'startx' from the command line. I would like a terminal command or a key-binding to be able to exit openbox and return to the command line. I just don't like using the menu with my notebooks touchpad.  I just can't seem to figure out what command is used. The menu.xml file lists the command as "Exit", but typing that in a terminal just exits the terminal.
    Any help appreciated.
    Last edited by badfrog88 (2010-09-05 19:08:43)

    gorky wrote:ctrl-alt-backspace won't do the job?
    IIRC, it's disabled by default in xorg-server 1.7 and newer.
    @ badfrog88
    Ctrl + C will kill (almost) any running app you point it to.
    Last edited by karol (2010-09-05 19:17:29)

  • Key binding in Forms 6i

    Hi All,
    I have a problem with key binding. I have tried different permutations of changing the key binding using the Oracle Terminal on FMRUSW.RES FILE to no avail. I have edited the keys of windows-sqlforms normal and used USER DEFINED KEY 2, etc but when I try to generate the file it gives the error 'failed to find action for user defined key 2 for an entry in "normal" in sqlforms. I have even gone to the extent of merely changing the bindings of the old entries to see whether it would work. It would give no error when generating but in the application the triggers did not work. I have even changed the Product Actions by inserting the code in the actions column but without any success.
    What I really want is for example to execute the key triggers in the application e.g. F2 would fire the trigger 'execute query', F3 to fire trigger 'copy', etc.
    I will appreciate any help I can get. Please note that I have gone through the numerous materials on the subject but they have not solved the problem.
    Thanks.
    Tunde

    Hi,
    I coded the key mapping as follows:
    I created a menu item. To call the code, you have to give a name for an accelerator key in the property palette for the menu item e.g. "start_menu".
    Let's say, to invoke the menu item, you have to press "Ctrl+E". So you have to set the key mapping in your *.res-file like this:
    69 : 2 : "Ctrl+E"           : 85 : "start_menu"
    Explaination:
    69: Code for "Ctrl+E"
    2: Java Modifier Number for "Control"
    85: Forms function number ("User Defined Key 3", look at the file I send to you !)
    I don't know, if that's the solution, because you wanted to map F1, F2...., but it shouldn't be a problem to switch my solution to F-keys. But perhaps, some of the Forms functions (e.g. F7 for Enter-Query-Mode) won't work then.
    Hope this helps.
    Regards,
    Markus

  • Adding a Key Binding Globally (to an entire JFrame)

    Hi, all. I'm trying the ever-so-common task of adding a global key binding to my little Swing app. I just wrote a very basic image converter for an obscure multi-frame format and one of the users requested that I add a simple feature: when control-N is pressed, the a new document is created (just as if the user had selected New from the File menu).
    I've read the Swing keybinding tutorial and I've tried to write a method to neatly contain the operation. The method is as follows:
        public static void setKeystrokeForAction(JFrame jframe, KeyStroke keystroke, Action action)
            jframe.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(keystroke, action.getValue(Action.NAME));
            jframe.getRootPane().getActionMap().put(action.getValue(Action.NAME), action);
        }This doesn't seem to work. I was under the impression that this would somehow allow any component focused in the frame to respond to the specified KeyStroke (in this case, control-N) and react by executing the Action provided (in this case, an action which calls the new document method in my application). However, I press control-N with various focused components and nothing happens.
    I know that the Action is sound because selecting the File : New item (which uses the same Action object) works just fine. The KeyStroke is constructed as follows:
    KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK)What am I missing?
    Thanks!

    Don't know why its not working. Its works fine for me in this example:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=312780
    Although the example uses WHEN_IN_FOCUSED_WINDOW I also tested it with WHEN_ANCESTOR... and it still worked fine.

  • How key binding in Oracle Forms works?

    Hi guys,
    This is my first time @ this forum.
    I tried to find documentation about this but no luck.
    I am new to Forms. Nevertheless, I know that in order to use key binding in Forms, fmrweb.res file is used. BUT....
    How the Form( client) know which key was pressed? Does the forms gets it from windows?
    I mean ,what kind of info(http request??) is sent over network to server ?
    Lets assume F12 is assigned as 113 key value.
    What happens over network when user clicks on keyboard F12?
    Is there any info about this?
    I read that when client accesses Forms application for the first time, java run-time classes bundled in JAR files are downloaded to client JRE cache. These files include frmall.jar, frmwebutil.jar and jacob.jar. This tells me there no conf files for client , only .class
    To summarize my complicated question:) : I would like to know how my form knows what was pressed, before it send this data to server, which will read fmrweb.res and understand in the end the actual functionality
    Thanks for your replies

    Let me start by saying "Welcome to the Oracle Forums" and more specifically to "Forms". Before going much further, I would recommend that you review the following page as it will help you to get the most valuable replies possible.
    http://blogs.oracle.com/shay/entry/10_commandments_for_the_otn_fo
    As for what you are asking, I am guessing that there is a more specific, underlying question you are asking. Is how Forms capturing key strokes internall really important? What are you trying to accomplish? The simple answer from a fairly high level is that the java client applet (frmall.jar) monitors for client activity (mouse clicks, keyboard actions, etc) and sends that information to the server. It is the Forms runtime process (frmweb) which is running on the mid tier that reacts (as required) to that event. So, it is the runtime process using the resource file and not the client. Also, you referred to frmwebutil.jar and jacob.jar. These files are only used for WebUtil enabled forms. The only file required for all applications is frmall.jar
    If your real question is, how to I doing something in my application as a result of a particular key press, then the answer to most of that is in the comments listed in fmrweb.res. Here is one example of how it works.
    Let say you wanted to have your app do something custom when F2 is pressed. In fmrweb.res, assign F2 is assigned to Forms function. Specifically a custom function. This would be one of the ones shown as "Function X". You can choose any one you like as these are not related to the key. In other words, the key F2 has no direct relationship with "Function 2" unless you decide to set it up that way. "Function 2" refers to the trigger in your form. So let's related the F2 key with Function 6. You entry in fmrweb.res would look something like this: 113  : 0 : "F2"  : 88 : "Function 6" Here's how this entry works:
    <blockquote>1. The 113 directly relates to the java awt key event 113
    2. The 0 indicates that no modifiers are to be included. This means that the only key pressed will be F2. There will be no Shift, Control, etc
    3. The next entry ("F2") is what is displayed when "Show Keys" is displayed from your form's help.
    4. The 88 is the internal ID number used by Forms which relates to an event. In this case, 88 refers to Function 6 or in other words, a KEY-F6 trigger in your form.
    5. The last entry is the description of what the key does. In other words, item 3 above indicates which key to press (to the user) and this entry explains what it does or represents. So in this case, you can change the wording "Function 6" to whatever you'd like.</blockquote>
    Again, most of this is explained in the comments of fmrweb.res although I understand it can be confusing.
    This to remember:
    <blockquote><li>You cannot have duplicate java events (with modifier). So be careful, if you duplicate an entry, likely nothing will happen. You can duplicate a java event so long as it has a modifier different from other similar entries. In other words, you can have a F2, Shift+F2, etc
    <li>Some keys are restricted by the OS and cannot be overridden. Exactly which ones will depend on your client OS and version. For example, on most Windows versions, you will not be able to override F1 however in some cases it may work. It will just depend on exactly which version you are using.</blockquote>

  • Remove the Enter key binding from a JPopupMenu

    Hi,
    Does anyone know how to remove the Enter key binding from a JPopupMenu?
    So when the popupmenu is showing and you type Enter, nothing should happen and the menu should stay where it is.
    I have tried:
    popup.getActionMap().put("enter", null);
    popup.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");but the popup always disappears.
    Any ideas?
    Cheers,
    patumaire

    First of all, that is not the proper way to "remove" a key binding. Read the Swing tutorial on [How to Use Key Bindings|http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto] for more information.
    However, we still have a couple of problems:
    a) the input map is dynamically built as the popup menu is displayed
    b) the input map is built for the root pane, not the popup menu
    The following seems to work:
    popup.show(...);
    InputMap map = getRootPane().getInputMap(JTable.WHEN_IN_FOCUSED_WINDOW);
    map.put(KeyStroke.getKeyStroke("ENTER"), "none");
    KeyStroke[] keys = map.allKeys();
    for (int i = 0; i < keys.length; i++)
         KeyStroke key = keys;
         Object action = map.get( key );
         System.out.println(key + " : " + action);

  • Key binding confusion

    I'm trying to use key bindings to navigate a table and do a few other things and I'm totally lost. The first picture in this thread gives you an idea of what my application looks like
    http://www.enginuity.org/viewtopic.php?t=8
    In the JInternalFrame, I have a JToolBar with some JButtons and JTextFields and a JPanel with an array of DataCells (extends JLabel). Basically, I want the arrow keys to move the data cell selection when any component is selected except the text fields.
    If the user types a number and neither text field is selected, I want the second text field to clear and take focus. When the user presses <enter> in that textfield, I want a method to be called (the same as clicking on the set value button). It'd also be nice if pressing a non-numeric (or dot) would not be input in those text fields.
    I'm confused though. How many key bindings do I need to use, and on what component? How many ActionMaps and InputMaps do I need? Do I need to make custom Actions? Sun's key binding "tutorial" just isn't making any sense to me.

    and a JPanel with an array of DataCells (extends JLabel). Use a JTable, it supports navigation using the arrow keys.
    Here is a simple example with InputMaps and ActionMaps:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class PanelActions extends JFrame implements FocusListener
         LayoutManager layout;
         public PanelActions()
              layout = new GridLayout(0, 10);
              JPanel  panel = new JPanel( layout );
              setContentPane( panel );
              Action rightAction = new AbstractAction()
                   public void actionPerformed(ActionEvent e)
                        JComponent c = (JComponent)e.getSource();
                        c.transferFocus();
              for (int i = 0; i < 30; i++)
                   String text = String.valueOf(i);
                   JLabel label = new JLabel( text );
                   label.setFocusable( true );
                   label.addFocusListener( this );
                   panel.add( label );
                 InputMap im = label.getInputMap(JLabel.WHEN_FOCUSED);
                   KeyStroke right = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0);
                   im.put(right, "right");
                   label.getActionMap().put(im.get(right), rightAction);
         public void focusGained(FocusEvent e)
              JLabel l = (JLabel)e.getSource();
              System.out.println(l.getText());
         public void focusLost(FocusEvent e) {}
         public static void main(String[] args)
              PanelActions frame = new PanelActions();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • Key binding won't work with alt-up and alt-left arrow combined

    I was playing with key binding trying to create a small app where a timer is started with the press of an alt-arrow key and stopped when the key is released. The timers append Strings to a JTextArea telling which alt-arrow key is currently pressed.
    This program works, and in fact if you press a combination of any two keys, both timers will work simultaneously, that is unless you press both up arrow and left arrow together. Can anyone see a bug in the program that explains why it won't work for these two particular keys when combined? Thanks in advance, Pete
    My SSCCE,
    KeyBindingEg.java
    package javaforum2009;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.*;
    public class KeyBindingEg {
      // parallel arrays -- sorry
      private static final int[] ARROW_KEYS = {
          KeyEvent.VK_UP, KeyEvent.VK_DOWN,
          KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
      private static final String[] ACTION_STRINGS = {
        "Up", "Down",
        "Left", "Right" };
      private static final String PRESSED = "PRESSED";
      private static final String RELEASED = "RELEASED";
      private static final int TIMER_DELAY = 100;
      private JPanel mainPanel = new JPanel();
      private JTextArea textArea = new JTextArea(20, 30);
      public KeyBindingEg() {
        JPanel northPanel = new JPanel();
        northPanel.add(new JLabel("This JTextField has the focus: "));
        northPanel.add(new JTextField(10));
        textArea.setEditable(false);
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(northPanel, BorderLayout.NORTH);
        mainPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);
        setBindings();
      private void setBindings() {
        int context = JComponent.WHEN_IN_FOCUSED_WINDOW;
        InputMap inputMap = mainPanel.getInputMap(context);
        ActionMap actionMap = mainPanel.getActionMap();
        for (int i = 0; i < ARROW_KEYS.length; i++) {
          // timer is started on key press and stopped
          // on key release.
          Timer timer = new Timer(TIMER_DELAY, new KeyTimerListener(
              ACTION_STRINGS));
    timer.setInitialDelay(0);
    // get input maps for all alt-arrow keys for both key press
    // and key release
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, false), ACTION_STRINGS[i] + PRESSED);
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, true), ACTION_STRINGS[i] + RELEASED);
    // set corresponding actions for the two different key presses above
    actionMap.put(ACTION_STRINGS[i] + PRESSED, new ArrowKeyAction(false, timer));
    actionMap.put(ACTION_STRINGS[i] + RELEASED, new ArrowKeyAction(true, timer));
    @SuppressWarnings("serial")
    private class ArrowKeyAction extends AbstractAction {
    private boolean onKeyRelease;
    private Timer swingTimer;
    public ArrowKeyAction(boolean onKeyRelease, Timer swingTimer) {
    this.onKeyRelease = onKeyRelease;
    this.swingTimer = swingTimer;
    public void actionPerformed(ActionEvent arg0) {
    if (onKeyRelease) {
    swingTimer.stop();
    } else {
    swingTimer.start();
    private class KeyTimerListener implements ActionListener {
    private String actionString;
    public KeyTimerListener(String actionString) {
    this.actionString = actionString;
    public void actionPerformed(ActionEvent arg0) {
    textArea.append(actionString + " pressed\n");
    public JComponent getPanel() {
    return mainPanel;
    private static void createAndShowGUI() {
    JFrame frame = new JFrame("KeyBindings Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new KeyBindingEg().getPanel());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

    camickr wrote:
    I noticed the problem a while ago with a similiar example and asked the same question to which nobody could give an explanation. The same observations seem to apply to your example in that using the numpad arrow keys work without a problem.
    [http://forums.sun.com/thread.jspa?threadID=5176816]
    Yes indeed. I suppose (as always) I should have searched the forum first before asking the question. Thanks for the link and info.
    /Pete

  • CR4E 2.0 key binding

    First of all, thanks a lot for this great piece of software. With the new version 2.0, supporting changes of POJO datasources in existing reports, I'm happy to the max - well, nearly
    There's one thing: it seems, that the CR4E somehow assigned some key bindings for itself, that mix up with my own. To name some, the HOME key (setting the text cursor to the beginning of the actual line in the editor) seems to be taken over by the CR4E to go to the "first page". Same with the "END" key (to jump to the end of a line in the editor), it's assigned by the CR4E to "last page" - all of this even then, if I'm not in the "Crystal" Perspective" and have no report file open.
    I wonder, whether it's really only me, that noticed this behaviour and how to fix his. I don't need a key in the Crystal Designer to jump to any page, but I can't live without jumping to the beginning or end of a line in my editors in eclipse.
    I haven't found a topic mentioning this problem, neither with the search function nor by clicking through the most recent posts or reading the notes about the new CR4E on the website.
    Any hints from the experts around here?
    TiA
    Markus

    Windows -> Preferences then select General -> Keys
    Find the "Line Start" command.  You should see it defined as Binding=Home, When=Editing Text.
    Copy that comand using "Copy Command".
    In the copy, specify When=Editing Java Source.
    This will bind Home to Line Start command when editing Java code. 
    Do similar for Line End, and also for other Edit Sources.
    My Eclipse Ganymede specifies Home as Crystal Reports Designer First Page and Editing Text Line Start, so it couldn't choose which to use when editing source.
    Didn't notice this issue till you mentioned it, since I had configured my Eclipse for "Emacs" key binding
    Sincerely,
    Ted Ueda

  • Custom key binding/macro

    Does anyone know of a way to bind/macro a particular key (e.g., "/" or "+") to omit it's normal function and instead paste custom text of your choice (e.g., "roger that") without using a third party program to do so? If a third party program is necessary to create the binding/macro, the only stipulation is that the key binding/macro must work without the program that created it open/running. Thanks ahead of time!

    and a JPanel with an array of DataCells (extends JLabel). Use a JTable, it supports navigation using the arrow keys.
    Here is a simple example with InputMaps and ActionMaps:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class PanelActions extends JFrame implements FocusListener
         LayoutManager layout;
         public PanelActions()
              layout = new GridLayout(0, 10);
              JPanel  panel = new JPanel( layout );
              setContentPane( panel );
              Action rightAction = new AbstractAction()
                   public void actionPerformed(ActionEvent e)
                        JComponent c = (JComponent)e.getSource();
                        c.transferFocus();
              for (int i = 0; i < 30; i++)
                   String text = String.valueOf(i);
                   JLabel label = new JLabel( text );
                   label.setFocusable( true );
                   label.addFocusListener( this );
                   panel.add( label );
                 InputMap im = label.getInputMap(JLabel.WHEN_FOCUSED);
                   KeyStroke right = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0);
                   im.put(right, "right");
                   label.getActionMap().put(im.get(right), rightAction);
         public void focusGained(FocusEvent e)
              JLabel l = (JLabel)e.getSource();
              System.out.println(l.getText());
         public void focusLost(FocusEvent e) {}
         public static void main(String[] args)
              PanelActions frame = new PanelActions();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • Override a key binding

    Is there a simple way to overide a key binding:
    I have a GUI and I want the SPACE key to do something, the same thing anywhere in the app.
    But the default behaviour is to fire the action on the object wich has the focus.
    I tried this:
    InputMap im = this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
              ActionMap am = this.getRootPane().getActionMap();
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,0),"myAction");
    am.put("myAction",new myActionClass(this));
    I.E. tried to redefine the key on the highest JComponent object with the WHEN_IN_FOCUSED_WINDOW scope but it did not work -> it still triggers the action on the buttons which has the focus in the button bar for example. I'm sure I did not understand the key bindings properly
    Do I need to remove the default SPACE binding for all object ?
    Is there a simple way to redefine the SPACE key binding for all my application, everywhere, not depending on what object has the focus ?
    Thanks a lot
    Zill

    I believe the WHEN_FOCUSED binding on the button will be applied before any WHEN_IN_FOCUSED_WINDOW bindings, so that won't work. You could simply ensure that your buttons never get the keyboard focus, by calling button.setFocusable(false) (I'm assuming jdk1.4+ here) on them when you create them. That won't affect menuitems or the buttons on built-in dialogs like JFileChooser and JOptionPane, but it might be sufficient.

  • Disabling of JScrollPane key binding

    In my application I want to use arrow keys, KeyStroke.getKeyStroke("UP"), to move around objects in a jgraph graph. I have defined a menu object for the application with an accelerator tied to "UP".
    The graph is displayed within a JScrollPane. Arrow keys are tied to the JScrollPane instead of my menu accelerator. All other accelerator keys in my menues work fine.
    I am trying to remove the InputMap key bindings of my created JScrollBar, but not successfully. The key binding of up is defined in the parent of the scroll bar, of type InputMapUIResource. This is the only parent. I remove the keybinding from the input maps, and it sticks. However the behaviour of the JScrollPane is not changed.
    Any suggestions? Is this the proper way to do this?
    Code snippet:
    JScrollPane pane = new JScrollPane(graph);
    KeyStroke up = KeyStroke.getKeyStroke("UP");
    InputMap im = pane.getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    while ( im != null ) {
    im.remove(up);
    im = im.getParent();
    }

    try this
    JScrollPane pane = new JScrollPane(graph);
    InputMap im = pane.getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");

  • Gnome Activities Key-binding.

    I have a steelseries keyboard with norwegian layout. The issue is that the "left super" key is replaced with a "steelseries" key for controlling media. Gnome-shell uses the "left super" key for lauching activities, but it does not exist, and that's the issue.
    Unity uses both left and right button for that, which I think is optimal, couse then I can just use the "right super" key for launching activities.
    In gnome-shell on Ubuntu i used caps lock for launching activities, which i configured in "System settings" --> "Region and Language" --> "Layouts" --> "Options..." --> "Caps Lock key behavior" --> "Make Caps lock an additional Super"
    This does not work with my gnome install on arch, so i have configured my key binding for activities to be "Left Alt + Space", which is not optimal and very annoying.
    Both the "right super" key and "caps lock" solution will work for me, but i don't know how to make it work on Arch...
    This is my xorg.conf
    ## xorg.conf
    ## GRAPHICS CARD
    Section "Device"
    Identifier "ATI Radeon HD4850"
    Driver "radeon"
    Endsection
    ## KEYBOARD
    Section "InputClass"
    Identifier "Keyboard"
    Option "CoreKeyBoard"
    Option "XkbLayout" "no"
    Option "XbkRules" "xorg"
    Option "XkbModel" "pc105"
    EndSection
    Thanks for any help!

    I found this by Googleing
    gnome extra keys
    http://www.redhat.com/archives/rhl-list … 03825.html
    It looks like the command to run the gnome search tool is "gnome-search-tool".  So just have a key binding conf that runs that command when you hit whatever button you want.
    If this doesn't help, don't give up on the Google hunt, try other variations of extra, like custom keys instead, and maybe you'll find a hit.  You might find an answer much faster than waiting for one in a forum.
    I would normally try this on my own machine, but I don't have Gnome installed. :]
    Good luck.

  • Defining a key binding for a character key

    I would like to redefine the behavior of a keyboard key that is associated with a Unicode character. For example, in a JTextField, I would like to override the default behavior which is to insert that character. The documentation I have seen recommends using InputMap and ActionMap. The problem I am running into is that defining a mapping for a KeyCode traps the KEY_PRESSED event, but the default action (which involves the KeyChar) traps the KEY_TYPED event. In other words, if I define a key binding for the intended KeyCode, the default binding for the associated KeyChar remains in effect. Is there a way to discover the mapping from KeyCode to KeyChar so that I can map the KeyChar to a null action? Or should I give up on InputMap and ActionMap and use an event listener?

    Sounds similar to [url http://forum.java.sun.com/thread.jspa?threadID=685442&messageID=3995916#3995916]this situation...
    : jay

Maybe you are looking for

  • Crashed while running V3.  Catalog now appears to have a "problem"...

    Standard configuration I've been running for MONTHS.  Asus P6T, i7 920, 6GB DDR3 memory, 4, 1TB disks.  Windows 7 Professional, 64-bit. Nothing special. In all the time I've been running this it HAS NEVER CRASHED.  I have NEVER gotten a BSOD.  It wor

  • Error Activating Message Mapping

    HI All, I am getting the below error when i try to activate any message mapping in the IR. Any ideas? " Starting compilation  Source code has syntax error:  java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Exception in thread "main" Thank you

  • Error while sending PO (with tax code) from SSP to SUS via MM

    Hello Experts We are implementing Self Service Procurement and Supplier Self Services scenario. We have created a SC with Tax Code say X in Self Service Procurement. The SC gets created as PO in R/3 (MM) system. The IDoc which is getting created in t

  • PHOTOSHOP CS6 PLUGIN PROBLEM; I have PS CS6

    PHOTOSHOP CS6 PLUGIN PROBLEM; I have PS CS6 & a mac osx 10.7.5  I have downloaded the pluginhttps://sourceforge.net/projects/panotools/  I drag it to the applications folder  (applications/photoshop/plugins) and it shows up there, but it does not sho

  • Document Resolution Clarification

    Hi guys, I am making a document that will only be displayed digitally. When setting up a new document I chose Web as my intent and set my pixels to 1400x900 ( same as Macbook pro- non retina). When i toggle my document to inches i get 20inx12.5in. No