Change return to control if pressed with other keys, to return if pressed alone… on Linux

0

My keyboard setup at home under MacOS uses Karabiner to "Change return to control if pressed with other keys, to return if pressed alone" and it works fine also inside Linux VirtualBoxes.

At work I have a Windows PC and to have the same behaviour I use AutoHotkey with

return::send {lctrl down}
return up::send % (a_priorkey = "enter") ? "{lctrl up}{return}" : "{lctrl up}"

but unfortunately inside Linux VMWares it doesn't work.

Is there a way to have the behaviour in Linux either passing the keystroke from host to guest or running a remapping tool under Linux?

Denis Cappellin

Posted 2019-04-30T20:05:43.077

Reputation: 111

Answers

1

At the end I've found a solution Remap Return to Control that use a couple of tools: xmodmap and xcape. Put the following lines in your .bash_profile

xmodmap -e "remove Control = Control_R"
xmodmap -e "keycode 0x69 = Return"
xmodmap -e "keycode 0x24 = Control_R"
xmodmap -e "add Control = Control_R"

xcape -t 5000 -e "Control_R=Return"

Denis Cappellin

Posted 2019-04-30T20:05:43.077

Reputation: 111