Remap meta key to other key on the keyboard - emacs

I have a programmable mechanical keyboard and can place any key anywhere.
At our company we recently switched to windows PCs and so that broke my emacs configuration because of the dreaded windows key which I tried to map to Meta but never got it to work.
Basically I use tigervnc to run vnc session that runs on linux.
Running emacs under linux in the VNC on a windows machine is a pain.
Every time I click the windows button to act as a meta the windows menu popup.
Anyways, I wonder if I can map Meta key to say "insert key", and the program the keyboard to have "insert" in place of "windows key" and vice versa.
I am also using ALT for other configurations so I don't want to map meta to ALT since I sometimes use all three combinations "Ctrl+ALT+Meta"+F-keys.
Is there a way to do so?

It would help if you can tell us which keyboard you own.
If it supports QMK firmware, you can just create two layers of keymaps for regular Windows usage and for VNC.

I think you will need to peruse Keymaps for Translating Sequences of Events (function-key-map et al).

Related

Disable all shortcuts that include option key modifier only, in VSCode on mac?

Is there any way to mass disable all keyboards shortcuts in VS Code on the Mac, that only use the option key as a modifier?
VS Code essentially has a breaking functionality on the Mac, whereby it uses the option key as a command trigger, even not when in combination with ctrl or command keys. This means that any characters only accessible by the option key aren't accessible. For example, on the US keyboard this mean I can't use 'option-m' to type in the 'µ' symbol or the accent dead-keys.
I have been told I just need to adjust the default short-cuts, but that will be a lot if I can't do it in batch, hence asking this question.
Note, my current workaround it to type these keys in Chrome and then copy/paste them, which is far from ideal.

vs code consistent keybindings for Mac and windows with settings sync

I use a windows computer for work and have painstakingly set up many keybindings for common tasks, as well as many other personalizations I really would like to have transferred to my personal computer, which is a Mac.
I recently found out about and set up Settings Sync, which is pretty awesome, but I can't seem to get my keybindings to work quite how I would like.
First, it doesn't seem that any of my keybindings transferred--when I open up the keyboard shortcuts on Mac and display User Keybindings, the list is empty, yet when I do this on Windows, all my keybindings are there.
To complicate matters, I sometimes use a Windows keyboard with my Mac. Without getting into too much detail, I'll explain what I'm trying to accomplish with a particular shortcut:
On windows machine, I use the right alt and ctrl keys to open up my integrated terminal with:
alt+ctrl+t
I'd like to keep this keybinding to work even when on my Mac because when I use my windows keyboard with it, I still have the alt and ctrl keys on the right side of the keyboard.
However, on my Mac without the windows keyboard, in place of the alt and ctrl keys I have the cmd and option keys, so in this instance I'd like cmd+option+t to trigger the integrated terminal.
So, is my solution to simply recreate all my windows shortcuts that use alt+ctrl with a corresponding cmd+opt version for Mac? And what about all the missing user keybindings that didn't seem to transfer with settings sync (logs show that they should've been transferred)? If anyone has any advice about how to properly set this up, I'd greatly appreciate it. Thanks.
It seems that Settings Sync synchronizes the user’s shortcuts by platform, which would prevent conflicts between Windows and Mac. So to achieve what you’re looking for, it should be enough to properly configure your shortcuts as you want them to be now in Mac.
There shouldn’t be any conflict when you move to your Windows machine, each platform should keep its own configuration :)

Using "xbindkeys" and "xdotool" to set fullscreen on firefox 60.1.0esr

My intention is to know if there is a way to set firefox-60.1.0 in fullscreen mode once it is opened to act as a kiosk, but using the Xbindkeys and Xdotool programs.
Note: I've already performed some tests, that's why I changed a little bit the scope of the original question.
XBindKeys uses a configuration file .xbindkeysrc for binding keys.
For example, I edited this file to set firefox in fullscreen mode by pressing shift + f keys combination. Then, this action activates the xdotool command to send the F11 key to the browser only if firefox is already opened:
# set firefox to fullscreen if opened
"xdotool search --classname navigator key F11"
shift + f
The problem is that it only works on firefox 52.8.0esr but my target is firefox 60.1.0esr and later versions.
So now, I´m wondering 2 things:
Will "xbindkeys" and "xdotool" programs be compatible with firefox-60.1.0 and later versions?.
Are there any Xclients replacement that are compatible with firefox-60.1.0 and later versions?.
Some other Xclients I have found are (but not tested so far):
xvkbd
xkb
xmodmap
..also other alternatives to xdotool such as autokey and more from these posts:
https://alternativeto.net/software/xdotool/?platform=linux
Note: I´m using centos for testing this.
Thanks for your help!
BR
So if I understand you, any keys are allowed before Firefox starts AND then only keys you want are allowed?
Use xbindkeys to start a shell script that:
remaps with xmodmap any keys you wish to surpress into something harmless
starts firefox as a background process
uses xdotool to send an F11 key to the firefox window
then waits for firefox to complete
and finally
uses xmodmap to restore the original keybindings.

emacs key commands different in Windows and Linux?

I'm trying to finally bite the bullet and learn emacs. Mainly so that I am comfortable editing files on a server through ssh. So I installed emacs on Windows in order practice. Right away I noticed this difference: when I press ctrl - rightarrow on windows, the cursor jumps to the next work. When I do this in emacs on the server, the cursor moves to the next character only. I believe the latter is the "normal" behaviour (M - rightarrow will jump to the next word in both versions). How can I get my windows emacs to behave exactly like the one on the server? I don't want to learn habits on windows that won't carry over to the server.
You mention server, I assume you are connecting to it over SSH? It is very likely that something over the route steals modifiers off your C-arrow movements.
If this is the case, try to edit your files locally. Here's how: How can I use Emacs tramp to ssh to a remote host and edit a file as another user on an ad-hoc basis?

Emacs in Mac OS Lion terminal - map right command key to meta

I just started using GNU Emacs on my Mac OS X Lion and I am trying to ease up my hand movement through various key bindings. Specifically, I want to be able to use the right command key for meta.
The following code in my .emacs file does the trick for the standalone application (Emacs.app)
;;; cmd key for meta
(setq mac-option-key-is-meta nil
mac-command-key-is-meta t
mac-command-modifier 'meta
mac-option-modifier 'none)
(Snippet taken from this Superuser answer)
but does not work with emacs run in terminal mode. The meta there is still the alt/option key which I set from the Terminal.app preferences. When I disable this option key, I lose the meta key capability all together.
Any ideas?
i'm not aware of terminal providing you with the ability to deal with the left/right command key mappings. iterm2 provides the means to accomplish what you're looking for there. albeit at a global basis for iterm2.
There appears to be keyremap4macbook that may save you some time if you must use emacs in terminal. I can take no credit for this, but this guy can