12

There is already a partial solution to the problem documented on askubuntu.com.

Unfortunately, it is not working for Ctrl+Alt+F[1-7] keys. There was a solution for that in Ubuntu 13.04 and eralier to enable "Special keys (Ctrl+Alt+key) handled in a server" in Keyboard Layout -> Options -> Miscellaneous compatibility options. There is also a general X11 xorg solution, but does nor work with Ubuntu 14.04 since it has no /etc/X11/xorg.conf. Also, I cannot find the corresponding option in gnome-tweek-tool, which is supposed to be used in this case according to Ubuntu developers.

How do I enable special keys Ctrl+Alt+F[1-7] in the server so that IntelliJ shortcuts work in Ubuntu 14.04?

9
  • It'd be simpler to configure the IntelliJ shortcuts, IMHO: jetbrains.com/idea/webhelp/configuring-keyboard-shortcuts.html
    – muru
    Aug 25, 2014 at 15:45
  • @muru Not in my case :/ I am using Windows, Mac and Linux depending on where I am (work, home, underground). I would like to have one short-cut map in IntelliJ.
    – Wojtek
    Aug 26, 2014 at 19:53
  • @muru Yeah, but I can not copy it to my co-workers box when I am pair-programming with him. I really wanna use the default keymap.
    – Wojtek
    Aug 27, 2014 at 12:34
  • 1
    Try out askubuntu.com/q/50233/158442
    – muru
    Aug 27, 2014 at 12:40
  • 2
    Also, there's an X option called DisableVTSwitch, or something, which will disable all thr ctrl-alt-f* shortcuts (I'd imagine chvt will still work).
    – muru
    Aug 27, 2014 at 12:42

5 Answers 5

9

You can use Ctrl+Alt+7 (rather than Ctrl+Alt+F7) and Alt+F7. you can change the default ubuntu keymap setting by setting->keyboard-> shortcuts->windows->move windows change "move window" shortcut and use Alt+F7 in android studio. It works.

3
  • 3
    Thanks Manish, but I do not want to change my shortcuts. I wanna keep them as they are.
    – Wojtek
    Sep 14, 2014 at 15:51
  • @Wojtek He is telling you how to change Ubuntu's use of the Alt-F7 key combination to some other key combination. That leaves it free for Intellij to use.
    – Lee Meador
    Oct 20, 2014 at 19:00
  • 1
    @LeeMeador I believe he is talking about Andoid Studio (IntelliJ), not Ubuntu and using different shortcuts, not the detault ones, which is what I do not want to do. The only way to disable Alt+F7 in Ubuntu is via already mentioned DisableVTSwitch, but I do not know how to do it in Ubuntu 14.04.
    – Wojtek
    Oct 21, 2014 at 12:28
3

In Ubuntu 14.02 you can change those workspace keys by

  1. "Start"-menu > System Tools > dconf Editor
  2. Navigate to org > gnome > desktop > wm > keybindings

Click on the key you want to "give its freedom" and change it. I changed F7 to F7.

After that IntelliJ recognized the key combination

1
  • 3
    I cannot see any Ctrl+Alt+F[1-9] values in there. Also, all names switch-to-workspace-[1-12] are ['disabled'] already.
    – Wojtek
    Oct 25, 2014 at 9:59
2

As Lee Meador mentioned, dconf-Editor should have the binding. It might be the case that it's under a different package though. For me the bindings for Ctrl+Alt+F* are under org.gnome.mutter.wayland.keybindings.

1
  • On my system they also were under that package. You can search for the switch-to-session-<X> shortcuts with the search tool of dconf-editor.
    – geronimo
    May 6, 2019 at 8:31
1

Lee's answer points in the right direction, but in Ubuntu 17.04 there is no "F7" keyboard mapping, so you cannot map it to "F7". However, the following did the trick for me:

dconf write /org/gnome/desktop/wm/keybindings/begin-move '["<Control><Shift><Alt><Super>F7"]'
dconf write /org/gnome/desktop/wm/keybindings/begin-resize '["<Control><Shift><Alt><Super>F8"]'
0

I found it! I found it!
(I copied my answer to this chat too)

There is a simple command line to disable the shortcuts Ctrl+Alt+F [1-7].
I don't know which versions of ubuntu support this command line, but on Ubuntu 18.10, it seems to work well.

setxkbmap -option srvrkeys:none

But the command line only seems to work when it is executed after the login: After each lock/logout, the shorcuts Ctrl+Alt+F [1-7]. Are enabled again.
I tried to put this line in "Startup Application" and also in ".profile". Either way, it doesn't work.

So I created a new shortcut that executes this command by pressing (for example) Super+F7. And it works fine!
I just must do Super+F7 after each login, and if after I do Ctrl+Alt+F7 there isn't any black screens!


Does someone know a better way to run a command line after the login?
Am I obliged to do Super+F7 after each login?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .