Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

xmodmap question: how to make Cmd key act like Win key (not Alt key)?


  • Please log in to reply
5 replies to this topic

#1 emendelson

emendelson

    Regular Member

  • Members
  • Pip
  • 16 posts
  • Graphics Card:Intel graphics
  • Operating System:Other OS/Not specified

Posted 25 February 2014 - 04:09 AM

I created a Wineskin that runs a Windows application called vDos (It's a DOS emulator based on DOSBox, but designed for applications not games). If I set it to use X1, and not the native Mac driver, the Option key on the Mac keyboard is correctly mapped to the Alt key in the application.

Unfortunately, the Cmd key on the Mac keyboard also acts like the Alt key in the application, and I am trying to make the Cmd key on the Mac keyboard send the codes for the Win key to the application instead. The application uses Win+F11 and Win+F12, and I can't make these work.

I'm running the latest Wineskin under OS X 10.9.1. If I try to run the copy of xmodmap inside the Wineskin bundle, it gives this error message:

dyld: Library not loaded: @executable_path/../Frameworks/libX11.6.dylib

  Referenced from: /Users/edward/WPDOSBox Files/vDos.app/Contents/Frameworks/bin/xmodmap

  Reason: image not found

Trace/BPT trap: 5


I'm afraid I'm a beginner at this, and I'll be grateful for any help in getting an .Xmodmap file that will map the Cmd key on the keyboard to the Win key in the application. Thanks in advance.

#2 dankoB

dankoB

    Legendary Member

  • Super Moderators
  • 3011 posts
  • LocationNew Brunswick, Canada
  • Graphics Card:MacBook Pro 11,3
    Core i7 16GB
    NVIDIA GeForce GT 750M
    2GB GDDR5 vRAM
  • Operating System:macOS 10.12 (Sierra)
  • I like to play:la rockitar
Author

Posted 25 February 2014 - 09:56 PM

I think this should suffice. Not sure if it's the type of fix you are looking for but the AppDB is a great location to troubleshoot stuff. It's very likely someone has encountered the same issue at some point. If you decide to sign up and ask for advice and help, be sure never to tell them you are using a front end like Wineskin. They only support system installed Wine. Meaning only one version can be installed on your system at one time...I think.

Hope it helps.

http://forum.winehq....pic.php?p=38959

#3 emendelson

emendelson

    Regular Member

  • Members
  • Pip
  • 16 posts
  • Graphics Card:Intel graphics
  • Operating System:Other OS/Not specified

Posted 25 February 2014 - 11:02 PM

Thank you - that was one of the pages that let me find the solution. Part of the problem is that if you have Mavericks, and you don't have a separate X11 installed (and I don't), then you can't use the xmodmap utility directly, and have to create and edit the .Xmodmap file by hand.

After reading a lot of pages, I eventually came up with this: The contents of my .Xmodmap file are as follows:

! keycodes 63 and 71 and left and right command keys
! keycodes 66 and sixty-nine are left and right alt keys 

keycode 63 = Super_L
keycode 71 = Super_R
keycode 66 = Alt_L Meta_L
keycode <<<SEE NOTE BELOW>>> = Alt_R Meta_R

clear mod1
clear mod4

add mod1	= Alt_L Alt_R
add mod4	= Super_L Super_R


<<<THIS IS THE "NOTE BELOW">>> Weirdly - when I type in "keycode" and the numerals six and nine, the BBS software replaces the numerals six and nine with the word "number" (I suppose to discourage teen-age boys from posting things they shouldn't), but if you use this code, make sure to use "keycode six nine" with those last two words as numerals; the numerals belong where "<<<SEE NOTE BELOW>>>" appears in the code.

I'm not sure how much of this code is actually needed, but it seems to work.

For those who wonder how to get an .Xmodmap file into a Wineskin, here's one easy way. Create a text file like the one above and name it Xmodmap (no dot) and save it in the Frameworks folder of a Wineskin. Then open a terminal window with the Frameworks folder as the current directory and enter this command

cp Xmodmap .Xmodmap

(note the dot before the second filename) which creates the invisible .Xmodmap file as a copy of the visible Xmodmap file.

To open a terminal window on the Frameworks folder easily, go to System Preferences, Keyboard, Shortcut, and under Services, Files and Folders, add a checkmark next to New Terminal at Folder. Then, with the Frameworks folder selected in the Finder, ctrl-click and choose New Terminal at Folder from the Services menu.

The program I'm using uses Win+F11 and Win+F12 to specific functions, and these now work correctly with Cmd+F11 and Cmd+F12. What I want to do now is figure out some way to make Cmd+F1, F2, etc. do nothing at all. Right now, they act like F1, F2, etc., which is mildly annoying but not serious.

EDIT: In an earlier version of this post I wasn't certain that both Win keys worked correctly. I now see that they do work correctly.

#4 doh123

doh123

    Wineskin Developer

  • Members
  • 4279 posts
  • LocationOver here
  • Graphics Card:Geforce GT 650M, Intel HD 4000, Radeon 6750, Intel HD 3000, Geforce 320m (in 3 machines)
  • Operating System:OS X 10.8 (Mountain Lion)
  • I like to play:RPG and Strategy

Posted 05 March 2014 - 03:14 PM

I dont know the keycodes... but you should install XQuartz and use it.  Any .Xmodmap you get working in XQuartz will work when you move it into the wrapper.

#5 emendelson

emendelson

    Regular Member

  • Members
  • Pip
  • 16 posts
  • Graphics Card:Intel graphics
  • Operating System:Other OS/Not specified

Posted 05 March 2014 - 04:07 PM

View Postdoh123, on 05 March 2014 - 03:14 PM, said:

I dont know the keycodes... but you should install XQuartz and use it.  Any .Xmodmap you get working in XQuartz will work when you move it into the wrapper.

Thanks - that clearly makes things easier!

#6 emendelson

emendelson

    Regular Member

  • Members
  • Pip
  • 16 posts
  • Graphics Card:Intel graphics
  • Operating System:Other OS/Not specified

Posted 14 April 2014 - 08:10 AM

And here are full details on how to map the Windows Alt key to the Mac Option key, and the Windows Win key to the Mac Cmd key, in both the Mac driver and the X11 driver:

http://www.columbia....winekeymap.html

I hope someone finds this useful.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users