Disable Escape key

I want do disable my Escape key (due to a hardware defect) and use the Caps lock key instead.
There exists a vast of tips how to map Escape to Caps lock, but what I want is:
* disable Escape key completely (because it's pressed randomly, tea accident, laptop keyboard)
* change the keymap files (create a new) under /usr/share/kbd/keymaps, not only use xmodmap
I'm from Germany and use the de-latin1-nodeadkeys map.
I tried the following:
# jakob.map: disable Escape and map Escape to Caps lock
include "de-latin1-nodeadkeys.map"
keycode 1 =
keycode 58 = Escape
But this does not disable the Escape key.
So, how can I completely disable that key?
Further questions:
* the Caps lock LED on my keyboard is still turning on and off, although it's now an Escape key -- is there a chance to change this behavior?
* can I change the current keymap while running, or do I have to put the name in rc.conf and reboot?

jakobm wrote:* can I change the current keymap while running, or do I have to put the name in rc.conf and reboot?
loadkeys: it is invoked by rc.sysinit
status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u $KEYMAP
As for your problem you could try to remap esc to some useless key like scroll lock as it's already been suggested.
I think loadkeys replaces the default key bindings made at boot by the kernel, so ESC is mapped to ESC because the standard american keyboard is like that and you have to specify explicitly to remove a binding, so leaving keycode 1 blank simply doesn't replace the value.

Similar Messages

  • JTree: disable ESCAPE key

    I want to disable the ESCAPE key on the editingComponent of a JTree.
    The following code works fine for disabling the ENTER key, but if I try to do the same
    thing for the ESCAPE key, it doesn't work.
    It seems that the ESCAPE key is defined at another level. Where could this be?
    * DisableEscape.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class DisableEscape extends JFrame {
        public JTree tree;
        public DisableEscape() {
            tree = new JTree();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
            tree.setCellEditor(new UserTreeCellEditor(tree, (DefaultTreeCellRenderer) tree.getCellRenderer()));
            tree.setEditable(true);
            pack();
        public static void main(String[] args) {new DisableEscape().setVisible(true);}
    * UserTreeCellEditor
    class UserTreeCellEditor extends DefaultTreeCellEditor {
        public UserTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
            super(tree, renderer);
        public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
            Component c = super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
            InputMap im = ((JComponent)editingComponent).getInputMap();
            KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
            im.put(enter, "none");//this works
            KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
            im.put(escape, "none");//this does not work
            return c;
    }Edited by: Andre_Uhres on Sep 24, 2007 2:20 PM
    removed irrelevant code

    It seems that you need another InputMap:
    InputMap im = ((JComponent)tree).getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);here is full working example
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public class DisableEscape extends JFrame {
        public JTree tree;
        public DisableEscape() {
            tree = new JTree();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
         UserTreeCellEditor editor = new UserTreeCellEditor(tree, (DefaultTreeCellRenderer) tree.getCellRenderer());
            tree.setCellEditor(editor);
            tree.setEditable(true);
         InputMap im = ((JComponent)tree).getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
         im.put(escape,"none"); //this works too
            pack();
        public static void main(String[] args) {new DisableEscape().setVisible(true);}
    * UserTreeCellEditor
    class UserTreeCellEditor extends DefaultTreeCellEditor {
        public UserTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
            super(tree, renderer);
        public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
            Component c = super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
            InputMap im = ((JComponent)editingComponent).getInputMap();
            KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
            im.put(enter, "none");//this works
            return c;
    }

  • How to disable detection of ESCAPE key in JDialog?

    Hi,
    I've implemented a non-modal JDialog, and to be sure the user doesn't close it I call setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)However, the user can always close it by pressing the ESCAPE key.
    Key binding does not work as the dialog is not a JComponent, and a KeyListener seems not to work.
    Is there a way to catch the ESCAPE key?
    Thanks in advance for any hint.

    However, the user can always close it by pressing the ESCAPE key.Is this a new feature in JDK1.5 or JDK6?
    The escape key is not supported by default in JDK1.4.2 so I'm surprised that its turned on by default in later versions.
    This is how I add the funtionality in JDK1.4.2:
    Action escapeAction = new AbstractAction()
         public void actionPerformed(ActionEvent e)
              System.out.println("escape");
              setVisible( false );
    KeyStroke escapeKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
    getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
         .put(escapeKeyStroke, "escape");
    getRootPane().getActionMap().put("escape", escapeAction);So, presumably you could override the default behaviour by using a dummy Action.

  • When I hit the escape key to close out the open file dialog box, firefox hangs or crashes.

    When I open the "open file" dialog box using the ctrl+O and then hit the escape key to exit the box, I get an error message which I'm not able to paste here.
    it says something about a runtime problem and if I try the same thing again to reproduce the problem, it will sometimes just hang and windows vista will tell me the program is not responding.
    I've checked to see if there are any crash IDs but none were found for this time frame.
    I have even disabled all add ons.
    I'm currently using vista 64 bit edition and Firefox 6, beta edition.

    Hi,
    Please also try right-clicking on the link corresponding to the language version and '''Save Target As''' to save the Firefox installer. If the problem persists, posting [http://answers.microsoft.com/ here] would also be helpful.
    [https://www.mozilla.org/en-US/firefox/all.html Firefox Latest]

  • Disabling Escape on the JSP page

    Hello,
    I wan to disable the Escape working on the JSP pages by using javascript.
    How can I do that? I wish that when a user makes an action and then presses the Escape key the form action should not halt. It should continue till form is not getting response.
    urgent Help needed

    Look at this,
    <html>
    <head><title>Check</title>
    <script language="javascript">
    <!--
    function doCheck() {
    if(document.myform.chk1.checked==true) {
         document.myform.del.disabled=false;
         document.myform.sub2.disabled=true;
    } else {
         document.myform.del.disabled=true;
         document.myform.sub2.disabled=false;
    //Your onDelete() method here
    //-->
    </script>
    </head>
    <body onload="javascript:document.myform.del.disabled=true">
    <form name="myform">
    <input type="checkbox" name="chk1" onClick="javascript:doCheck()" ><br>
    <input type = "button" value="delete order" name="del" onclick= "javascript: return onDelete()"><br>
    <input type="submit" name="sub2" ><br>
    //You put the other button code here instead of submit.
    </form>
    </body>
    </html>Sudha

  • 3.2.3;Capture Escape key on all along a Frame?

    A frame has several components like buttons, textfield, Combo,GridControl and so on. For some reason which i don't know why, The rows on gridControl disappears and replaces with blank rows, if Escape key pressed immediately after this Frame loaded.
    And an error message raises says some of the conditions on rowSet which is bound to grid are null.
    I debugged this frame and couldn't find the bug. Now needed some how to trap the Escape key and disable it. Please advice.
    null

    repost

  • Escape Key ruins my application

    Escape Key messed up big time with my app. To name the
    problems, there were three major bugs possible to occur when I
    repeatedly hit the ESCAPE key when my app is running (of course on
    Projector) :
    1. Some animations (sprite) drew back to frame 1.
    2. Sometimes in some part of my app, it failed my projector
    to call certain Custom Functions. And in some other cases, it
    somehow disabled (or maybe removed) certain Sprite Behaviors. Thus,
    making that game not playable when it happened.
    3. It also made some error such as :
    Handler not found in Object. #play
    I knew it's gotta be something to do with my Flash Sprite,
    but to surprise me, I found out that no keydown script should be
    running when that error occured.
    In my conclusion, these things related to my pressing ESCAPE
    key repeatedly when playing the app.
    Is there anyone else who has experienced the same problem
    with me? Is there a solution this? Maybe I can lock the Escape key.
    But, hey, I need the Escape key to let user Skip certain parts of
    my game.

    quote:
    Originally posted by:
    wherold
    look in your documentation under "exitlock".
    No, wherold. It was not exitLock. I already set it to False.
    Now I know that the sprite that drew back to frame 1 was my
    fault. But, how the Escape key messing up with Custom Functions
    still amaze me. I managed to find a solution: using baDisableKeys
    at certain events in the game. -_-
    :) Wolfgang

  • Is it possible to disable escape command that is quiting without warning?

    When I press in Camera Raw 7.3 escape key, picture is quiting without any warning or saving changes.
    Is it possible to disable escape command in ACR ?
    thanks in advance
    Peter

    Petrbr9 wrote:
    Come on! Could you tell me any professional application, that discards all your work after you have pressed just one key?…
    Any application, whether professional or otherwise, that uses modal dialog boxes follows the universal convention where the Escape key equals hitting the CANCEL button in the modal dialog box.
    Remember that ACR is just a plug-in, and the way that plug-in is designed is to work through a single modal box with multiple tabs and settings.
    Petrbr9 wrote:
    …In some applications Esc is rolling out the last action but not the whole work…
    …and there is your answer: until you hit either Done, Open or Save in the ACR modal dialog box, you have not applied any action to your work at all, you have just been looking at the preview when you manipulate the sliders and fields in the various tabs.
    It's no different than calling up a filter in Photoshop, say a noise-reduction filter, and hitting the Escape key before applying the settings to the image after fiddling with the sliders.
    My advice remains to keep in mind ACR is a modal dialog box and stop hitting the Escape key before applying your settings to the image.  It is that simple.  After all, the darned Escape key is physically located way out in the back of left field on the keyboard for that reason.
    Incidentally, if you expect to get help here in these user to user forums in the future, you'd better lose the attitude, buddy.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers: 
    http://forums.adobe.com/thread/419981?tstart=0
    Thank you.
    Excerpt:
    • Do not be abusive or aggressive in your tone
    An aggressive or abusive sounding post will often evoke an aggressive or abusive and unhelpful reply
    Remember, you are requesting help from other users, just like you, who are giving their time free of charge. No one is under any obligation to answer your question.
    Message was edited by: station_two — Edited obvious typos.

  • Default behaviour of the Escape key while editing a cell in JTable??

    Hi all,
    i have a Jtable which get its data from an own model object which extends DefaultTableModel.
    If i overwrite the isCellEditable(row, col) method within the tablemodel object and set a specific column to editable, then i notice while editing a cell in that column that the default behaviour of the Escape key is that independet from what you have entered before in to the cell the editing stops and the cell gets the value it had before editing.
    This is the case for me even if i apply a custom editor to a column (one that extends DefaultCellEditor). It is just a JTextField that limits the number of digits a user can enter. Everything works fine. If the user edits the cell and presses ENTER or the "down arrow key" i can check what he has entered with the help of the getCellEditorValue() method. But if the user hits the ESC key after editing a cell this method is not invoked!!!
    My question is :
    is there any way to detect that the user cancels editing with the ESC-key.
    this is very important for me because if the user goes editing the cell i lock the related record in the database, if i cannot detect this it is locked till the application terminates.
    Thanks for any help in advance

    I try override the JTable editingCanceled() ==> does not work.
    I try the addCellEditorListener( CellEditorListener l ) ==> does not work.
    Finally, I try the addKeyListener ==> it works.
    Here is a quick demo. program:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class Test {
    public static void main(String[] args){
    JFrame f = new JFrame();
    String[] colName = {"a", "b"};
    String[][] rowData = {{"1", "2"}, {"3", "4"}};
    JTable table = new JTable(rowData, colName);
    JTextField t = new JTextField(10);
    t.setBackground(Color.red);
    t.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
    // do what ever you want ex. un-lock table
    System.out.println("ESCAPE");
    DefaultCellEditor editor = new DefaultCellEditor(t);
    TableColumnModel colModel = table.getColumnModel();
    for (int i = colModel.getColumnCount()-1; i >= 0; i--) {
    colModel.getColumn(i).setCellEditor(editor);
    f.setContentPane(new JScrollPane(table));
    f.pack();
    f.setVisible(true);

  • How can I disable a key through software?

    A friend of mine spilt water on her keyboard. As a result, her forward slash key frequently spams and makes typing difficult. I used a program to remap the forward slash key to a forward delete key, but that has also caused problems. What I'm looking for is a program that will allow me to completely disable a key.
    I should note, I've used KeyRemap4Macbook and I've also developed my own code, which disables the key on Cocoa applications. However, the key still spams on applications like Microsoft Word.
    Her Macbook is more than a year old, and she can't afford to buy a new one.
    Any suggestions?

    Liquid in a physical keyboard is great trouble. You may worsen state if you continue to use it like this, make the effort to change it. It is not cheap, but may prove cheaper than damage the whole computer.

  • My Escape key is not working

    Hi,
    I am Meena.
    I am doing a project using NetBeans and MS-Access.
    When I run my project a internal framed named login loaded on the jdesktoppane which in JFrame.
    So in the login internal frame i used two buttons one for Sign-in and another for sign out.
    So I combined the Sign-in button with Enter key and Sign-out button with Escape key by the following coding.
    I wrote the following coding in LoginInternalFrame->properties->enabled->advanced->Generate PreIntialization Code.
    Action EscFromLogin=new AbstractAction()
    public void actionPerformed(ActionEvent e)
        jButton2.doClick();
    Action OkFromLogin=new AbstractAction()
        public void actionPerformed(ActionEvent e)
           jButton1.doClick();
    getRootPane().getInputMap(jButton2.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0,false),"Esc_in_Login");
    getRootPane().getActionMap().put("Esc_in_Login",EscFromLogin);
    getRootPane().getInputMap(jButton1.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false),"Ok_in_Login");
    getRootPane().getActionMap().put("Ok_in_Login",OkFromLogin);In the above coding Enter key works well no problem.that is when I press the Enter key ,it combined with Sign-in button and works well.
    But when I press Escape key,it doesnot combined with Sign-off button.
    that is nothing is happening when I press Esc key.
    So i change the Escape key and test with F1 then F2 then F3 all are combined with Sign-off button and works well.But only the escape key is not working.
    But I have so many internal frames .In all internalframes my esc key works well.But not in the first inter frame(login internalframe)
    I couldnot understand the reason.
    Will you please help me to solve.
    Thank you so much.
    Meena

    mmm, i'm doing some tests and the case is working for me... The reason F1,F2 keys works while ESC don't is that some component is "eating" the ESC key. Probably your password textField, but it is not its default behaviour. For example, try to replace the textField with a FormattedTextField, write something into it and press ESC, this first ESC is consumed by the FormattedTextField, if you press ESC a second time the FormattedTextField not consume it, so the ESC keystroke processing is given to the rest of the componentes until one of they consume it (basically). So, how can you solve th problem? Try to determine which component is the "escape-eater". Once you detected it try to determine which properties are set and if this properties can alter the keyboard mapping. The problem can be difficult to repeat for us because the look and feel, java version, etc. can affect the system behaviour too. A global hook to ESC can also be the reason (maybe esc key it's not reaching ths components), try to override ProcessKeyBindings and log the results....

  • Using the Escape key in simulations and assessments

    I have recently recorded a simulation/assessment that needs to use the Escape key to close a pop-up window and returns to the main application window. The recording has not been an issue; however, using Escape with failure messages is proving to be tricky.  Here's what I have discovered while resording my sim/assess, along with my questions:
    When I press Escape, Captivate captures this keystroke as a shortcut attached to a Click Box. This works on the assessment side, but fails to produce a failure message on the assessment side when the user does not press the Escape key.
    I need to produce a failure message when the user  does not press Escape.
    Can I storethe unicode value of Escape in a TEB variable and then use an if . . . else statement to either advance to the next slide (success action) or produce a caption that mimics a failure caption?  If so, how would I write this item?
    Could I use a Loss of focus trigger instead?
    Does Captivate have a variable that records a unicode value (Something like CPKeyPressedValue"?
    Are there any other alternatives?

    In the case of buttons and clickbox objects, where clicking is allowed, the failure is normally registered when the user CLICKS OUTSIDE the button or click box.  The evaluation of Success/Fail happens on the click.
    In the case of a Text Entry Box, the interactivity is all about what the user enters into the text field and whether or not it is correct/incorrect when compared to approved answer text.  The main purpose of the TEB object is not centered on the clicking of the button that accompanies the text field.  The button just provides a way to trigger the Success/Failure evaluation of the user interaction with the text field.
    Since you have deselected Allow Mouse Click for your click box, you've effectively made it mandatory to use keystrokes to trigger the Success/Failure evaluation of the object. So clicking outside the box is no longer going to do anything because Allow Mouse Click is off.  You'll get a failure message on this click box now for many (but not all) keystrokes that are not the one assigned.
    By the way, using the Escape key as a keystroke if you Preview the project in Captivate just shuts down the preview (as you've probably already found out).

  • Escape Key Not Working

    Hi Gang
    Was surprised to see the escape key can no longer end/stop a capture. I have to manually stop the camera and wait a second for FC to say 'reached end of edit/tape'. I poked around in system Prefs and FC Keyboard Functions - couldn't find anything?
    Umm?
    Mike

    Hi James
    Actually I spoke too soon ....
    The problem returned.
    I cleared the keyboard commands - reset them - escape performed ok the 1st time, but then the problem returned again

  • How can I get the escape key to work again?

    I've used "esc" to get out of VI's insert mode for 40 years. I am not going to relearn that keystroke as "ctl-esc", period. Even if I were to do that, then I'd be typing ctl-esc on other platforms where it would not work because I have to type "esc" alone. If there is a way to fix in in System Preferences->keyboard, I cannot find it. If there is not, then it is completely 100% brain-dead wrong. I hope that's not the case.  So there is definitely a bug:
    The key-up event on the escape key does not cause the escape key code to be delivered to the active window when no other key is pressed, or
    The UI is sufficiently obtuse that the cause of the suppression cannot readily be found.
    I do hope it is merely the latter because I am compelled to use Outlook and Outlook does not work properly under OS/X 10.6.  (Our Exchange Server is rigged to only allow Outlook clients to send email outside of the company.)
    Thank you.

    The answer is:  The bug is in the UI.  Speech recognition was enabled, by default it uses the bare escape key as a "mic on" indicator, and it does not leave any trace in the keybord configuration.  So that is the bug.  It needs to leave a trace there, a la: "X Listen-for-voice-command  ^" under Mission Control.

  • Disable Function Key F3 in Internet Explorer

    I would like to disable function keys F1 and F3 while playing
    my flash movie in internet explorer. I am using these keys within
    Flash to do some actions.
    I got the script working for Function Key F1 using the
    following script
    <script language="javascript">
    document.onhelp = function() {return(false);}
    window.onhelp = function() {return(false);}
    </script>
    But unable to make it to work for function key F3.
    Thanks in advance,
    Desmond

    Hi des_shun, I have workaround for this issue.
    First thing we have to do is disable keyboard event for F3 key on HTML document so that even if focus is on html document, default Search functionality will not popup. Next thing is, flash must contain KeyboardEvent listener for keyboard response. This is where we will keep our custom F3 functionality. This setting works well on Chrome & FireFox.
    Now IE thing.
    The prolem with IE is that if any one of F3, F5, F6,F7 & F11 key is pressed, when the focus is on flash movie it directly executes the default browser functions like searching, refreshing etc never allowing flash to execute its keyeventlistener. But if focus is on document body, then F3 and other keys work fine.
    Here is the catch.
    All we have to do is whenever focus is shifted to flash, we should revert that focus to document body.
    Here is how we can do this.
    Capture the MouseClick event in your flash movie. Then in this mouseclick event handler, call  javascript function to change focus to document again. Below is the sample code.
    //Flash Code
    stage.addEventListener(MouseEvent.CLICK,mClick);
    function mClick(event:MouseEvent)
              ExternalInterface.call("changeFocus");
    // Javascript Code
    <script type="text/javascript"</script>
              function changeFocus()
                             document.body.focus();
        </script>
    Thats it!

Maybe you are looking for

  • Can anyone please tell me how does MIDI sound with new drivers (2.15.0002 - 30th May

    Can anyone check this out for me? I'm intending to switch to Vista if there are no issues, so please, would anyone please check if there are any dropouts or delays during playback of MIDI files (especially with a lots of fast notes)? Please?

  • HT4211 Facetime - does it support airplay mirroring ?

    I tried airplay mirroring from my iphone 5s to my TV using Digital AV adapter,am not getting anything on the screen. 

  • Backups taking too long

    My Time Capsule backups are taking too long. Time Machine says it is indexing. However, I have had my Time Machine configured since I installed Lion last year and it has been making automatic backups every hour since. Why is it 'indexing' now, and wh

  • Sale of iPhone 4gb

    I will be selling my "vintage" 4gb iphone this summer. I'll either be purchasing the current 3g model or the one that MIGHT be coming out this June or July. My questions is this: When the buyer of my 4 gb phone activates it, I assume AT&T will just p

  • GARAGE BAND TO ITUNES TO IMOVIE not recognising Garageband files from iTunes

    Hi there. I am trying to import interview voice files from Garageband into iMovie. I have used the Share option to export to iTunes and have then opened iMovie to drag the files from my iTunes lists. Files showing up in iMovie  as '0' secs in length.