Opened 4 years ago

Closed 4 years ago

Last modified 17 months ago

#398 closed feature request (Behaves Correctly)

Mapping command to control.

Reported by: lhunath@… Owned by: jeremyhu@…
Priority: Nice to Have Milestone: 2.5.1
Component: xserver Version: 2.5.0 (xserver-1.7.6)
Keywords: Cc:

Description

Mapping the command key to control would go a long way to giving a more integrated feel between X clients and native OS X applications.

We are used to Cmd-C for copying text, Cmd-V for pasting it, Cmd-Q for quitting applications, etc. X clients are generally written for PCs that use the Control key as the modifier for these actions. Simply mapping Command to Control would immediately seamlessly fix most of these key binds. Command is currently rarely (dare I say, never?) used by X clients, so this shouldn't be an issue. Cmd-Q should also not quit the XQuartz application but be sent to the focussed X client.

Change History (10)

comment:1 Changed 4 years ago by lhunath@…

FWIW, I currently use the following to achieve this; but it'd be nice if this were configurable (or even the default) for the benefit of the general populous:

! ~/.Xmodmap
clear Mod2
clear control
keycode 63 = Control_L
keycode 67 = Control_L
add control = Control_L

comment:2 Changed 4 years ago by jeremyhu@…

  • Milestone set to 2.5.1
  • Resolution set to behaves correctly
  • Status changed from new to closed
  • Version set to 2.5.0 (xserver-1.7)

No. command in OSX is meta in UNIX. Control in OSX is control in UNIX. The only ambiguity is Alt and Mode_switch in UNIX both being Option in OSX. And this has a toggle switch in preferences.

comment:3 Changed 4 years ago by jeremyhu@…

cmd-c is the edit menu's copy already.

ctrl-c in your X11 application is your X11 application's fault. ctrl-c does not mean "copy" in UNIX. It means "break". Microsoft changed this, and some developers targeting linux wanting to make it feel more like windows followed suit by breaking linux.

comment:4 follow-up: Changed 4 years ago by lhunath@…

So you're basically saying the responsibility for this is either with the user to manually map his Meta key to Control or with the application to use the Meta key as command modifier (eg. support a relatively Mac-specific key layout).

I agree that this seems like the best approach for a generic X11 server; however, seeing as XQuartz is an X11 server which very specifically targets only OS X as host, perhaps certain assumptions may be made.

Though on the other hand; they would cause perhaps an unacceptable deviation from standard X11.

comment:5 in reply to: ↑ 4 Changed 4 years ago by jeremyhu@…

Replying to lhunath@…:

So you're basically saying the responsibility for this is either with the user to manually map his Meta key to Control or with the application to use the Meta key as command modifier (eg. support a relatively Mac-specific key layout).

Actually, the irony of this is that using the Meta key as command modifier is not "a relatively Mac-specific" key layout. Mac's are actually following suit with the rest of UNIX in using Mac OSX's Command like UNIX's Meta.

The applications you are running are incorrectly using control instead of command in order to be more "Windowsy"

I agree that this seems like the best approach for a generic X11 server; however, seeing as XQuartz is an X11 server which very specifically targets only OS X as host, perhaps certain assumptions may be made.

Yes. That is what has been done:

OSX's Command = X11's Meta

OSX's Control = X11's Control

OSX's Option = X11 Alt or X11 Mode_switch

Though on the other hand; they would cause perhaps an unacceptable deviation from standard X11.

comment:6 follow-up: Changed 2 years ago by pelleter@…

For anyone like me which also likes to use the command key on the right as a control equivalent within X11.
I used the tool xev and got the keycode 71 for it.
So create the .Xmodmap like so:
clear Mod2
clear control
keycode 63 = Control_L
keycode 67 = Control_L
keycode 71 = Control_L
add control = Control_L

comment:7 in reply to: ↑ 6 ; follow-up: Changed 2 years ago by pelleter@…

Replying to pelleter@…:

For anyone like me which also likes to use the command key on the right as a control equivalent within X11.
I used the tool xev and got the keycode 71 for it.
So create the .Xmodmap like so:
clear Mod2
clear control
keycode 63 = Control_L
keycode 67 = Control_L
keycode 71 = Control_L
add control = Control_L

err sorry about the newbie formatting above...

comment:8 in reply to: ↑ 7 Changed 2 years ago by pelleter@…

For anyone like me which also likes to use the command key on the right as a control equivalent within X11.

I used the tool xev and got the keycode 71 for it.

So create the .Xmodmap like so:
clear Mod2
clear control
keycode 63 = Control_L
keycode 67 = Control_L
keycode 71 = Control_L
add control = Control_L

comment:9 Changed 17 months ago by sorin.sbarnea@…

Can please someone implement this in the default configuration of XQuartz, not having it is a major productivity issue. It's far from being only a nice-to-have feature.

comment:10 Changed 17 months ago by jeremyhu@…

sorin, just use ~/.Xmodmap (see the comment just before yours) ... that's what it's there for.

Note: See TracTickets for help on using tickets.