How to make Windows key the IntelliJ IDEA Command/Meta key under Windows? - windows

I'm using IntelliJ IDEA 14 under OS X, Windows and Ubuntu for several months, found that the keymap Mac OS X 10.5+ is more suitable for me and want to keep same experience under all platforms.
OS X has five modifier keys: Shift, Caps Lock, Control, Option, and Command, while Windows/Ubuntu has only four: Shift, Caps Lock, Control and Alt. If I want to use Mac OS X 10.5 keymap under Windows/Ubuntu, then I need map a key to Command key which plays a great role.
Under Ubuntu I remapped Windows key to Meta key using xmodmap, but I could not find how to do it under Windows. I've tried key remappers such as SharpKeys, but none of them can remap keys to Command/Meta key. So is there a way to do it?

Here's a workaround that works partly. In IDEA do the following:
Help -> Edit Custom Properties...
In the file that opens, add this on a new line: keymap.windows.as.meta=true
Choose your Mac keymap under File -> Settings... -> Keymap. For example, "Mac OS X 10.5+".
If you use a Windows keyboard and you want the same layout as with your Mac keyboard you can remap
the left Windows key to become the left Alt key and
the left Alt to become the left Windows key, that would then be interpreted as the Mac's Command (Cmd/Meta) key.
To do so, you could install AutoHotkey and run it with the following script, by putting these two lines in a .ahk file:
LAlt::LWin
LWin::LAlt
To read more about the problem(s) with both the Windows key and this workaround see the comments of IDEA-144702.

Related

Display and change active keymap

I have a very complex setup:
German keyboard
Windows laptop
Through VDI web client to a windows machine
To an emacs running on VDI
All tools in the Windows VDI see the correct keymap, but my emacs does not. I am not talking about key bindings (yet, that will be the next problem). I am talking about the simple keypresses: I press a z and emacs sees a y
What puzzles me is that emacs is the only tool with this problem: it seems it does not recognize the selected keymap in the windows vdi.
How can I check what keymap is active in emacs? How can I change it?
I am NOT talking about key bindings.

How Mac keyboard can issue Alt key input in Apache Guacamole

I am using XFCE terminal in Debian linux on Apache Guacamole from MacOS X.
I'm trying to navigate between tabs in the XFCE's terminal using ALT key shortcuts (e.g. ALT+1 and ALT+2) like shown in the screen below:
I've tried every key combination I can think of, plus researched at places like this. But I haven't yet figured out the secret.
How can I issue these ALT- key combinations from my Mac keyboard in Guacamole?
Usually the modifier key ALT on a PC means "alternate" which would translate to Mac's keyboard symbology as Option (on some Macs drawn with a branching-switch icon):
Solution (when Guacamole uses realVNC)
According to realVNC (one of the possible connection protocols by Guacamole) your needed "from Mac to PC" key mapping would be:
Pressing "CmdL" (left Command key on your local Mac) will result in "AltL" (left Alt key on the remote PC/Linux)
Insightful thoughts
When using Guacamole, which probably uses VNC or XRDP protocol to connect your local client (Mac) to the remote server (Linux), the keyboard mapping has to pass 2 layers, from your local hardware/OS (Mac) to browser, over Guacamole/XRDP to the remote-system (Debian with XFCE).
All these layers can interpret the key-events triggered.
Research
Like a user of this XRDP-related forum post from MacRumors (from 2015) explains:
As below link states, Alt key of PC keyboard should be mapped as Option key on OS X. This is what we see on ARD. On XRDP Alt key behaves like Windows key and is mapped to Command key.
See also:
RealVNC Help Center: Keyboard Mapping To and From a Mac
AskDifferent: Can't get Alt (Option) key to work while remote controlling a Mac from Windows with VNC, reverse direction, but might give a clue
AskUbuntu: Remote desktop to Ubuntu has wrong keyboard mapping
Griffon's IT Library blog: XRDP – How To Make your keyboard “special keys” (Alt+Gr, Up,Down,..) working when using XRDP

How does VS Code use the help/insert key "normally" on macOS? (Not have it intercepted)

I'm using macOS Catalina on an iMac with a WASD Keyboard configured for Mac use. The keyboard includes the usual PC keyboard bank of six keys of Insert/Home/Page Up and Delete/End/Page Down.
I run the current (auto updating) VS Code. It just works, including the Insert key for toggling Insert/Overwrite.
Most applications, including Terminal and Xquartz, can't see the Insert (Help) key. No input is registered if you press the key.
How is VS Code able to see the Insert/Help key when pressed?
The answer is, VS Code is not special. Rather XQuartz has an option to enable key equivalents (Cmd-Q, Cmd-W, etc.) under X. This also causes the interception of the Insert key.
You may disable this for behavior ALL X applications at once via the X11 Preferences or via the command:
defaults write org.macosforge.xquartz.X11 enable_key_equivalents -boolean false
Reference: https://www.manpagez.com/man/1/Xquartz/

Qt: how to define Cmd+key shortcut for MAC

I'm absolutely new to Qt.
How do I define a Cmd + numeric key key sequence on Mac in code?
For Windows I have
QKeySequence(QString("Ctrl+") + QString::number(number));
where number is, say, 2
What should be the same for a MAC cmd key?
And, is it possible for Qt to determine somehow if we are running on Mac or Windows (so I could create key sequence as appropriate)?
As noted in the Qt::Modifier enum documentation:
Note: On Mac OS X, the CTRL value corresponds to the Command keys on
the Macintosh keyboard, and the META value corresponds to the Control
keys
The QKeySequence documentation is more detailed:
Note: On Mac OS X, references to "Ctrl", Qt::CTRL, Qt::Control and
Qt::ControlModifier correspond to the Command keys on the Macintosh
keyboard, and references to "Meta", Qt::META, Qt::Meta and
Qt::MetaModifier correspond to the Control keys. Developers on Mac OS
X can use the same shortcut descriptions across all platforms, and
their applications will automatically work as expected on Mac OS X.
So if you are just using Ctrl on Windows/Linux and Cmd on MacOS, you don't need to change anything just use the Windows sequence.

Chrome Remote Desktop Keyboard Shortcut Needed

I'm using Chrome Remote Desktop on a Windows Desktop to access an Apple iMac. I cannot figure out how to invoke the Apple Command key function from my Windows keyboard. I would think that the Windows key would work but it doesn't. Is there a way to map the Windows key to the Apple Command key? I really want to be able to invoke copy and paste from the keyboard, which are Command-C and Command-V on the iMac, so I'm stuck because I don't have a "Command" key.
My solution to this problem is to leverage the handy "Configure Key Mapping" command provided by the latest version of Chrome Remote Desktop (v. 77.0 at the time of writing). The option is available in the sidebar as shown below.
Clicking the link opens the "Configure Key Mapping" dialog, from which you can create your own mapping. An important thing to note is that the keycodes supported by Chrome Remote Desktop are not the usual "ASCII" codes to which every developer is used to (I did this error myself the first time); rather, the codes should be taken from the "UI Events KeyboardEvent code Values" W3C standard. If you go through the standard you'll find the useful "List of code values for functional keys in the Alphanumeric section" table, which I also replicate below.
Concretely, let's say you want to map your local (Windows) Ctrl key to the remote (Mac) Cmd key. From the table above we see that the code for the (left) Ctrl key is "ControlLeft", while the code for the Cmd key is "MetaLeft", so from the "Configure Key Mappings" dialog:
click "New Mapping"
enter "ControlLeft" in the "from" field
enter "MetaLeft" in the "to" field
if needed, click [New Mapping] to enter more key mappings
the configuration should now look like in the image below. Click [Done] to close the dialog window.
At this point you should be able to use Ctrl-C, Ctrl-V etc. on your local PC to trigger the corresponding Cmd-C, Cmd-V etc. commands in the remote Mac. The solution works quite well for me and it resolves a perennial problem of how to use the Cmd button while on a Windows PC without having to rely on external apps or plugins.
I'm on a Windows 10 machine remoting into an El Capitan Mac (yes, it's an old OS, but it's a 2009 model that can't be upgraded any higher). If the other solutions don't work for you (they didn't for me), you can try adding Mac keyboard shortcuts in Keyboard settings. I use this mac as a home server and only use it via Chrome Remote Desktop, so I am not worried about messing up keyboard shortcuts when using the computer's keyboard directly.
Go to Settings > Keyboard > Shortcuts > App Shortcuts and add new shortcut mappings for Copy and Paste to the Ctrl key.
On Windows 10
Alt + Window + C
Alt + Window + V
On an Acer C7, the right control key maps to command. In fact, the Search key maps to command too, which is far more helpful, but available on fewer keyboards.
Well, it seems I can use the Windows Key to send the CMD Key straight away to the Mac machine. I have tried:
Windows + C: copy
Windows + V: paste
Windows + X: Cut
Windows + W: close window
Windows + Q: close application
All work nice!
However you can't use this:
Windows + Tab: switch between applications,
it is already used by Windows for the same function.
But you can still use "holding the mouse middle wheel and moving the mouse up" to see all open applications. It is a little bit painful, but does most jobs.
If things don't work - try map MetaRight to ControlLeft
I have windows keyboard connected to a mapbook. I had to swap the modifier keys: Command <-> Control.
The problem was that when connecting with the Chrome Remote Desktop to a Linux machine, the remapping MetaLeft to ControlLeft did not work. Turned out it's because the macbook remapped the left key to the MetaRight what whatever reason.
I have confirmed, using chrome remote desktop, that search+another_key does the same as CMD+another_key while remote-connected to my mac-book pro over home WiFi. I also noted that if I want to enter two search+another_key presses sequentially, I must release and repress the search key after each instance
You can map keybindings, just not that im on a mac remoting to a windows PC (with a windows keyboard) and I noticed that MetaRight is the windows key (as oppose to Meta left).
If you want to use e.g. WIN-key + C to represent Cmd + C on mac, other than "Configure key mappings" (WIN-key seems mean Cmd on mac by default?), you need to go to full-screen checkbox by the right-side's blue-sliding bar (F11 doesn't work for me).
Only in that full-screen mode, WIN-key + something is not occupied by the Windows OS.
Go Full-Screen first
In order to use all shortcut keys, you need to go full screen from the Windows PC that is accessing the Mac. This option can be found in the side menu on the right.
Then use the ⊞ Win key for all the ⌘ Cmd key shortcut keys on Mac

Resources