NoMachine NX 'p' key not working for Macbook Pro vs Fedora - macos

My 'p' key is dead within a NX session. I'm on a Macbook Pro with Snow Leopard (10.6.8) and I'm NX'ing into a Fedora instance. I NX into other machines and don't have the same problem.
I've read plenty on dead keys and odd mappings but nothing relating to the 'p' key. I've checked the modifiers via xmodmap -pm on both machines, there's no mention of the 'p' key.
I've run out of ideas.. Anyone else come across this?

This is caused by the two keyboard short-cuts using the "Windows" alias "Super" key
the 'p' and 'tab' keys works again if you remove those two short-cut in the (xfce) config.

I find I lose the 'p' key when I shift focus from osx to the nx session. Tapping any modifier key (ctrl, option, command...) recovers it. Completely repeatable. I've tried various ways of logging the key presses, but it's as if the 'p' key is not being detected at all.
Mac Pro, 10.6.8 client, into Scientific Linux 6.2 (RHEL6.2 clone)

Related

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/

How can I map a hardware key to another key on my Apple Mac Book Pro (Catalina)

Just got a new Mac Book Pro (Catalina OS), but was disgusted to find there is no hardware Esc key. As a developer this is a must. I did find you could map 4 special keys to Esc (things like Shift-lock) but I don't want to do this. I want to map § to Esc. I'm sure this is possible with some OS hackery, but how?
This worked for me. I put it into my ~/.bash_profile, I only need it for vim.
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000029}]}'
On other mac keyboards it might not be 64, so you can test by mapping keys to 'A'
0x700000004 is A
All codes https://developer.apple.com/library/archive/technotes/tn2450/_index.html
If you screw it up: hidutil property --set '{"UserKeyMapping":[]}'

How to make Windows key the IntelliJ IDEA Command/Meta key under 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.

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.

Resources