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?
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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?
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?
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.