remap ctrl, alt and command keys in osx

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
projectIncomplete
Newbie
Newbie
Posts: 3
Joined: Sun Jan 31, 2010 3:17 pm

remap ctrl, alt and command keys in osx

Post by projectIncomplete »

Is there any way to remap keyboard keys in wine on osx.

For example:
Right now when I press command on the (mac) keyboard I get an alt in wine.
I would like to remap the windows ctrl to windows alt so when I press command I get an ctrl in wine. This way I can command+C to copy.

I allready tried to mess arround with the registry in wine, but so far I have found no solution.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: remap ctrl, alt and command keys in osx

Post by vitamin »

projectIncomplete wrote:Is there any way to remap keyboard keys in wine.
No, there isn't a way to do it. Not a modifier keys - you will break too many parts that depend on exact state of each modifier key (ctrl,shift,alt, num-lock, caps-lock).

If you really want to try - use xmodmap. However that affects entire X, not just Wine.
projectIncomplete
Newbie
Newbie
Posts: 3
Joined: Sun Jan 31, 2010 3:17 pm

Post by projectIncomplete »

That's fine. I would probably want to do it for all the windows programs any way and i don't use X11 for anything else.

I'll give it a try, thanx!
projectIncomplete
Newbie
Newbie
Posts: 3
Joined: Sun Jan 31, 2010 3:17 pm

Post by projectIncomplete »

Ok i've done it! :)

Here a complete discription of how it is done:
(Just to be clear what this does: it remaps the keyboard layout inside of X11 to mimic the windows keyboard layout on a mac keyboard, if you use X11 for something else other then wine it may not be wise to do this! You are warned!)

open x11 and goto preferences

on input tab check "Follow system keyboard layout"

close preferences

with x11 as the acvite app press command+N this will open an xterm window

type the following and press ENTER (this will create an .Xmodmap file, if you already have one it will be overwritten!):
xmodmap -pke > ~/.Xmodmap

then type the following en press Enter to open the file for editing:
open -e ~/.Xmodmap

then change the following keycodes:
keycode 63 = Control_L
keycode 66 = Meta_L
keycode 67 = Control_L

open the x11 preferences

on input tab uncheck "Follow system keyboard layout"
and uncheck "Enable key equivalents under X11"

close and restart X11
Locked