jEdit Community - Resources for users of the jEdit Text Editor
Can't use Alt key in jEdit 5 under Mac OS X
Submitted by avamk on Sunday, 29 July, 2012 - 23:35
Hello,

I am trying to get my Alt key to work in Mac OS X. Whenever I try to use it as part of a shortcut, it instead writes a symbol (which symbol depends on what character I hit on the keyboard) into my buffer.

I searched for previous posts, and one suggested modifying my startup.bsh. I tried but still couldn't get my Alt key to function. Can someone tell me what I am doing wrong? Below is the section in my startup.bsh:

/*{{{ Remapping modifier keys part I */

/* The below is the default, swap the items around to
* change meaning of C+, A+, M+, S+.
*/
//KeyEventTranslator.setModifierMapping(InputEvent.CTRL_MASK,
// InputEvent.ALT_MASK, InputEvent.META_MASK,
// InputEvent.SHIFT_MASK);

/* ... and this the MacOS default: */
KeyEventTranslator.setModifierMapping(InputEvent.META_MASK, /* == C+ */
InputEvent.CTRL_MASK, /* == A+ */
InputEvent.ALT_MASK, /* == M+ */
InputEvent.SHIFT_MASK /* == S+ */);

/*}}}*/

/*{{{ Remapping modifier keys part II */

/* Note if you chose to make use of the M+ (option key) prefix on MacOS, you
* will need to disable a little piece of code: */
Debug.ALT_KEY_PRESSED_DISABLED = false;
/* Otherwise M+ will be ignored for the purposes of keyboard shortcuts. */

/* But if you enable this, you might find that Option+8 for example invokes your
* macro but also inserts a bulletpoint, as per standard Macintosh keyboard
* behavior. To disable the Option key for inserting special high ASCII
* characters, uncomment this. Note that it has wider implications, notably
* DROVAK keyboard shortcuts will be mapped as if the keyboard was QWERTY. */
Debug.ALTERNATIVE_DISPATCHER = false;

/*}}}*/
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Anyone?????
by avamk on Thu, 02/08/2012 - 19:22
Anyone?????
 
Still works
by rsam on Sat, 18/04/2015 - 15:25
Hi avamk,

it's been long, but to anyone reading this recently: the given trick still works as of Apr 2015.
The tutorial where I found that information was however specifying the wrong path. It has probably changed across versions of jEdit or OSX. In my case I found the startup script at ~/Library/jEdit/startup/startup.bsh.

If you edit that file with the above info, you will be able to assign shortcuts to the option key/Alt.

Cheers,
Rsam.
User login
Browse archives
« September 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   97301
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18600
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18030
R Edit Mode - extensive version   0.1   17480
Advanced HTML edit mode   1.0   16212
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15235
XP icons for jEdit   1.1   14299