Menu

#127 Cannot generate ALT+Key chars on non English KBD

normal bug
closed-fixed
5
2000-10-17
2000-08-29
No

I have a Portuguese keyborad on a Mac. Some chars, like [ and { are generated by alt+key combinations. jEdit seems to ignore this. Is there a workaround?

Discussion

  • Slava Pestov

    Slava Pestov - 2000-08-30

    This is a known bug. However, I do not have an international keyboard and hence cannot fix it. If you want to take a look at the source and come up with a fix, go ahead.

     
  • Joaquim Carvalho

    I fear I lack expertise to try a fix myself. If it helps here is a snipped I found to fix the same problem in JText components (original code by Miguel Calejo
    for the Interprolog open Source package. contact: interprolog@servisoft.pt ) :

    private static final JTextComponent.KeyBinding[] altGrBindings = {
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('['), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(']'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('{'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('}'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('@'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(''), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(''), "insert-content" )
    };

    .... then in the code that constructs the Interface:

    prologInput = new JTextArea(4,80);

    // add those few precious key bindings...
    JTextComponent.loadKeymap(prologInput.getKeymap(), altGrBindings, prologInput.getActions());

    I have tried this in other Swing programs and it works both in Windows and in mac portugese keyboards.

    Do you think this could work with JEdit?

     
  • Joaquim Carvalho

    I fear I lack expertise to try a fix myself. If it helps here is a snipped I found to fix the same problem in JText components (original code by Miguel Calejo
    for the Interprolog open Source package. contact: interprolog@servisoft.pt ) :

    private static final JTextComponent.KeyBinding[] altGrBindings = {
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('['), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(']'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('{'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('}'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke('@'), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(''), "insert-content" ),
    new JTextComponent.KeyBinding( KeyStroke.getKeyStroke(''), "insert-content" )
    };

    .... then in the code that constructs the Interface:

    prologInput = new JTextArea(4,80);

    // add those few precious key bindings...
    JTextComponent.loadKeymap(prologInput.getKeymap(), altGrBindings, prologInput.getActions());

    I have tried this in other Swing programs and it works both in Windows and in mac portugese keyboards.

    Do you think this could work with JEdit?

     
  • Jaroslav Misura

    Jaroslav Misura - 2000-09-04

    I found (maybe) simmilar problem using french keyboard. I can write {} without problems, but when I want to write [] jEdit decides to change it to ][ . Strange. There is no such problem using english kb with same jEdit. I have tried jdk 1.2.2/win and jdk1.3/win. I am not sure if it is related to your problem, so I will report this as a new bug.

     
  • Slava Pestov

    Slava Pestov - 2000-10-17
    • assigned_to: nobody --> spestov
    • milestone: 101610 --> normal bug
    • status: open --> closed-fixed
     

Log in to post a comment.