4

I've tried setting org.gnome.desktop.input-sources to ['space:ctrl'] but it doesn't work.

Note: I want the spacebar to keep working as before (Space should trigger both Ctrl and Space, I don't mind the conflict).

seriousdev
  • 185
  • 2
  • 14
  • Please show us the exact command you used. – Gunnar Hjalmarsson Aug 08 '16 at 17:19
  • Did it via dconf-editor, these are the exact values I used. – seriousdev Aug 08 '16 at 17:33
  • What's the output of `gsettings get org.gnome.desktop.input-sources xkb-options`? – Gunnar Hjalmarsson Aug 08 '16 at 18:09
  • I tested, and it didn't work for me either. Probably it's not a valid `xkb-options` value. You can run `localectl list-x11-keymap-options` to view a list of valid values. – Gunnar Hjalmarsson Aug 08 '16 at 18:54
  • You wanted _Space should trigger both Ctrl and Space_, but what it should do for shortcuts which needs combination of Ctrl and Space? Not at least with preserving the original behaviour. What I understand from the question is, you wanted the space to act like Ctrl when you want it and like Space, when you don't. That's not possible now – Anwar Aug 17 '16 at 06:40
  • @Anwar You misunderstood: I don't mind the conflict since I never use Ctrl and Space together. – seriousdev Aug 17 '16 at 15:34
  • This is a very good good question. Me just looking up different ideas https://github.com/r0adrunner/Space2Ctrl https://github.com/alols/xcape – William Jul 07 '20 at 12:43

1 Answers1

1

From a terminal run:

xmodmap -e 'keycode 65=Control_R'

To undo, type:

xmodmap -e 'keycode 65=space'

In general, to see the list of all keysyms that you can map and their names, type:

xmodmap -pk
  • Not working for me on Ubuntu 16.04. Tried mapping both Control_R and Control_L but the usual shortcuts aren't working in any application. Also I'd like for the spacebar to still work as before, I'll update my question to reflect this. – seriousdev Aug 15 '16 at 16:27
  • Mmm, does [this](http://unix.stackexchange.com/a/11184) or [this](http://askubuntu.com/a/158014/308164) answer help? –  Aug 15 '16 at 18:54