Rebinding/disabling CTRL+ALT+F# Virtual Terminal/Console SwitchingHow to send all keystrokes to a screen...

Can a US President, after impeachment and removal, be re-elected or re-appointed?

Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

Security measures that could plausibly last 150+ years?

May a hotel provide accommodation for fewer people than booked?

Is it unprofessional to mention your cover letter and resume are best viewed in Chrome?

How to efficiently shred a lot of cabbage?

Why are subdominants unstable?

Move arrows along a contour

Spider-Man and Fantastic 4 crossover comic with Double Identity Scene

Complaints from (junior) developers against solution architects: how can we show the benefits of our work and improve relationships?

Embedded C - Most elegant way to insert a delay

Why does one get the wrong value when printing counters together?

Coworker mumbles to herself when working, how to ask her to stop?

Would it take any sort of amendment to make DC a state?

How do discovery writers hibernate?

Why are prop blades not shaped like household fan blades?

How does Asimov's second law deal with contradictory orders from different people?

Can I attune a Circlet of Human Perfection to my animated skeletons to allow them to blend in and speak?

Why put copper in between battery contacts and clamps?

Can machine learning learn a function like finding maximum from a list?

Can living where Earth magnetic ore is abundant provide any protection?

Was Donald Trump at ground zero helping out on 9-11?

Avoiding Implicit Conversion in Constructor. Explicit keyword doesn't help here

Word for soundtrack music which is part of the action of the movie



Rebinding/disabling CTRL+ALT+F# Virtual Terminal/Console Switching


How to send all keystrokes to a screen session?Disabling or changing console switching keysCentOS: Avoid that ALT-F4 switches to consoleKeyboard shortcut for SIGTERM in GUI application?Suspending the global KDE&X-Windows keyboard shortcuts while specific application is runningHow to disable ctrl-alt-del and /etc/init/control-alt-del.conf in Linux?Does there exist a kernel hook to know which tty is currently active?Keyboard shortcuts in the virtual terminalsetting custom shortcut global in LinuxCentOS virtual console is displaying blank with a blinking cursorLinux Virtual Console (ctrl+alt+f2) scrolls past edge of monitor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







21















I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke.



Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer.



The distributions in question are Fedora 16 and Ubuntu 11.10.










share|improve this question



























  • I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

    – njsg
    Mar 14 '12 at 16:48











  • @njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

    – Volker Siegel
    Jul 23 '14 at 9:49


















21















I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke.



Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer.



The distributions in question are Fedora 16 and Ubuntu 11.10.










share|improve this question



























  • I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

    – njsg
    Mar 14 '12 at 16:48











  • @njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

    – Volker Siegel
    Jul 23 '14 at 9:49














21












21








21


10






I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke.



Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer.



The distributions in question are Fedora 16 and Ubuntu 11.10.










share|improve this question
















I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke.



Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer.



The distributions in question are Fedora 16 and Ubuntu 11.10.







x11 keyboard-shortcuts tty console virtual-consoles






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









RobertL

5,0316 silver badges26 bronze badges




5,0316 silver badges26 bronze badges










asked Mar 14 '12 at 16:12









JesJes

2561 gold badge2 silver badges10 bronze badges




2561 gold badge2 silver badges10 bronze badges
















  • I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

    – njsg
    Mar 14 '12 at 16:48











  • @njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

    – Volker Siegel
    Jul 23 '14 at 9:49



















  • I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

    – njsg
    Mar 14 '12 at 16:48











  • @njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

    – Volker Siegel
    Jul 23 '14 at 9:49

















I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

– njsg
Mar 14 '12 at 16:48





I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration.

– njsg
Mar 14 '12 at 16:48













@njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

– Volker Siegel
Jul 23 '14 at 9:49





@njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt.

– Volker Siegel
Jul 23 '14 at 9:49










4 Answers
4






active

oldest

votes


















9














Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection


You will also need the following to cause events to be passed through to clients connected to the display:



Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


(That last bit is untested, refer to its source.)






share|improve this answer




























  • This does not forward the combination to the window, X still catches it.

    – Jes
    Mar 14 '12 at 19:25






  • 2





    After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

    – Jes
    Aug 14 '12 at 20:52








  • 2





    Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

    – Rob Dawson
    Apr 15 '13 at 0:11






  • 3





    If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

    – Xiao Peng - ZenUML.com
    May 17 '16 at 7:43






  • 1





    Just to confirm this works on FreeBSD 11 too.

    – gsl
    Jul 7 '17 at 17:25



















15














The following invocation of the X11 setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:



setxkbmap -option srvrkeys:none


To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:



setxkbmap -option ''


To print the current settings invoke setxkbmap -print.



To invoke per user, put the command in the ~/.xinitrc file.



To invoke when an Xsession starts, create a file in



/etc/X11/Xsession.d


such as



/etc/X11/Xsession.d/65srvrkeys-none


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.



For more information type man setxkbmap at your shell prompt or see the Xorg setxkbmap man page.



I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.



I prefer to modify the X window system via the X11 command line interfaces. If that does not work, then I attempt the desktop environment. As a last resort I would modify system configuration files. Implementations and file formats change, but command line interfaces live almost forever in the Unix/Linux tradition.






share|improve this answer




























  • Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

    – glts
    Nov 13 '15 at 8:48











  • I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

    – J.Serra
    Apr 15 '16 at 14:01






  • 1





    It works on Linux Mint 18. Thank you.

    – Hoang Tran
    Jul 17 '17 at 12:01






  • 1





    It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

    – MikeyE
    Sep 27 '17 at 18:34








  • 1





    Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

    – Per Lundberg
    Jul 8 at 13:32



















1














You can disable this by going to System settings -> keyboard layout -> option.
under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".



I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... .
but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.






share|improve this answer




























  • You are right Ubuntu does not catch it, but I suspect that the X server does.

    – Jes
    Mar 26 '13 at 14:45






  • 3





    Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

    – o_nix
    Oct 30 '13 at 12:11





















0














In Ubuntu 18.04 you need to create the following file:



/usr/share/X11/xorg.conf.d/65-setxkbmap


with this content:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


then reboot your system.






share|improve this answer


























  • Except for the filename, this has been suggested in the accepted answer.

    – RalfFriedl
    May 11 at 21:16














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f34158%2frebinding-disabling-ctrlaltf-virtual-terminal-console-switching%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























4 Answers
4






active

oldest

votes








4 Answers
4






active

oldest

votes









active

oldest

votes






active

oldest

votes









9














Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection


You will also need the following to cause events to be passed through to clients connected to the display:



Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


(That last bit is untested, refer to its source.)






share|improve this answer




























  • This does not forward the combination to the window, X still catches it.

    – Jes
    Mar 14 '12 at 19:25






  • 2





    After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

    – Jes
    Aug 14 '12 at 20:52








  • 2





    Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

    – Rob Dawson
    Apr 15 '13 at 0:11






  • 3





    If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

    – Xiao Peng - ZenUML.com
    May 17 '16 at 7:43






  • 1





    Just to confirm this works on FreeBSD 11 too.

    – gsl
    Jul 7 '17 at 17:25
















9














Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection


You will also need the following to cause events to be passed through to clients connected to the display:



Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


(That last bit is untested, refer to its source.)






share|improve this answer




























  • This does not forward the combination to the window, X still catches it.

    – Jes
    Mar 14 '12 at 19:25






  • 2





    After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

    – Jes
    Aug 14 '12 at 20:52








  • 2





    Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

    – Rob Dawson
    Apr 15 '13 at 0:11






  • 3





    If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

    – Xiao Peng - ZenUML.com
    May 17 '16 at 7:43






  • 1





    Just to confirm this works on FreeBSD 11 too.

    – gsl
    Jul 7 '17 at 17:25














9












9








9







Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection


You will also need the following to cause events to be passed through to clients connected to the display:



Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


(That last bit is untested, refer to its source.)






share|improve this answer















Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection


You will also need the following to cause events to be passed through to clients connected to the display:



Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


(That last bit is untested, refer to its source.)







share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 14 '16 at 3:30









Julie Pelletier

7,0251 gold badge15 silver badges40 bronze badges




7,0251 gold badge15 silver badges40 bronze badges










answered Mar 14 '12 at 17:24









Sam MorrisSam Morris

6665 silver badges7 bronze badges




6665 silver badges7 bronze badges
















  • This does not forward the combination to the window, X still catches it.

    – Jes
    Mar 14 '12 at 19:25






  • 2





    After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

    – Jes
    Aug 14 '12 at 20:52








  • 2





    Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

    – Rob Dawson
    Apr 15 '13 at 0:11






  • 3





    If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

    – Xiao Peng - ZenUML.com
    May 17 '16 at 7:43






  • 1





    Just to confirm this works on FreeBSD 11 too.

    – gsl
    Jul 7 '17 at 17:25



















  • This does not forward the combination to the window, X still catches it.

    – Jes
    Mar 14 '12 at 19:25






  • 2





    After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

    – Jes
    Aug 14 '12 at 20:52








  • 2





    Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

    – Rob Dawson
    Apr 15 '13 at 0:11






  • 3





    If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

    – Xiao Peng - ZenUML.com
    May 17 '16 at 7:43






  • 1





    Just to confirm this works on FreeBSD 11 too.

    – gsl
    Jul 7 '17 at 17:25

















This does not forward the combination to the window, X still catches it.

– Jes
Mar 14 '12 at 19:25





This does not forward the combination to the window, X still catches it.

– Jes
Mar 14 '12 at 19:25




2




2





After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

– Jes
Aug 14 '12 at 20:52







After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke.

– Jes
Aug 14 '12 at 20:52






2




2





Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

– Rob Dawson
Apr 15 '13 at 0:11





Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :).

– Rob Dawson
Apr 15 '13 at 0:11




3




3





If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

– Xiao Peng - ZenUML.com
May 17 '16 at 7:43





If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes.

– Xiao Peng - ZenUML.com
May 17 '16 at 7:43




1




1





Just to confirm this works on FreeBSD 11 too.

– gsl
Jul 7 '17 at 17:25





Just to confirm this works on FreeBSD 11 too.

– gsl
Jul 7 '17 at 17:25













15














The following invocation of the X11 setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:



setxkbmap -option srvrkeys:none


To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:



setxkbmap -option ''


To print the current settings invoke setxkbmap -print.



To invoke per user, put the command in the ~/.xinitrc file.



To invoke when an Xsession starts, create a file in



/etc/X11/Xsession.d


such as



/etc/X11/Xsession.d/65srvrkeys-none


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.



For more information type man setxkbmap at your shell prompt or see the Xorg setxkbmap man page.



I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.



I prefer to modify the X window system via the X11 command line interfaces. If that does not work, then I attempt the desktop environment. As a last resort I would modify system configuration files. Implementations and file formats change, but command line interfaces live almost forever in the Unix/Linux tradition.






share|improve this answer




























  • Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

    – glts
    Nov 13 '15 at 8:48











  • I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

    – J.Serra
    Apr 15 '16 at 14:01






  • 1





    It works on Linux Mint 18. Thank you.

    – Hoang Tran
    Jul 17 '17 at 12:01






  • 1





    It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

    – MikeyE
    Sep 27 '17 at 18:34








  • 1





    Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

    – Per Lundberg
    Jul 8 at 13:32
















15














The following invocation of the X11 setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:



setxkbmap -option srvrkeys:none


To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:



setxkbmap -option ''


To print the current settings invoke setxkbmap -print.



To invoke per user, put the command in the ~/.xinitrc file.



To invoke when an Xsession starts, create a file in



/etc/X11/Xsession.d


such as



/etc/X11/Xsession.d/65srvrkeys-none


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.



For more information type man setxkbmap at your shell prompt or see the Xorg setxkbmap man page.



I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.



I prefer to modify the X window system via the X11 command line interfaces. If that does not work, then I attempt the desktop environment. As a last resort I would modify system configuration files. Implementations and file formats change, but command line interfaces live almost forever in the Unix/Linux tradition.






share|improve this answer




























  • Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

    – glts
    Nov 13 '15 at 8:48











  • I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

    – J.Serra
    Apr 15 '16 at 14:01






  • 1





    It works on Linux Mint 18. Thank you.

    – Hoang Tran
    Jul 17 '17 at 12:01






  • 1





    It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

    – MikeyE
    Sep 27 '17 at 18:34








  • 1





    Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

    – Per Lundberg
    Jul 8 at 13:32














15












15








15







The following invocation of the X11 setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:



setxkbmap -option srvrkeys:none


To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:



setxkbmap -option ''


To print the current settings invoke setxkbmap -print.



To invoke per user, put the command in the ~/.xinitrc file.



To invoke when an Xsession starts, create a file in



/etc/X11/Xsession.d


such as



/etc/X11/Xsession.d/65srvrkeys-none


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.



For more information type man setxkbmap at your shell prompt or see the Xorg setxkbmap man page.



I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.



I prefer to modify the X window system via the X11 command line interfaces. If that does not work, then I attempt the desktop environment. As a last resort I would modify system configuration files. Implementations and file formats change, but command line interfaces live almost forever in the Unix/Linux tradition.






share|improve this answer















The following invocation of the X11 setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:



setxkbmap -option srvrkeys:none


To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:



setxkbmap -option ''


To print the current settings invoke setxkbmap -print.



To invoke per user, put the command in the ~/.xinitrc file.



To invoke when an Xsession starts, create a file in



/etc/X11/Xsession.d


such as



/etc/X11/Xsession.d/65srvrkeys-none


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.



For more information type man setxkbmap at your shell prompt or see the Xorg setxkbmap man page.



I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.



I prefer to modify the X window system via the X11 command line interfaces. If that does not work, then I attempt the desktop environment. As a last resort I would modify system configuration files. Implementations and file formats change, but command line interfaces live almost forever in the Unix/Linux tradition.







share|improve this answer














share|improve this answer



share|improve this answer








edited 49 mins ago

























answered Nov 11 '15 at 7:47









RobertLRobertL

5,0316 silver badges26 bronze badges




5,0316 silver badges26 bronze badges
















  • Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

    – glts
    Nov 13 '15 at 8:48











  • I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

    – J.Serra
    Apr 15 '16 at 14:01






  • 1





    It works on Linux Mint 18. Thank you.

    – Hoang Tran
    Jul 17 '17 at 12:01






  • 1





    It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

    – MikeyE
    Sep 27 '17 at 18:34








  • 1





    Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

    – Per Lundberg
    Jul 8 at 13:32



















  • Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

    – glts
    Nov 13 '15 at 8:48











  • I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

    – J.Serra
    Apr 15 '16 at 14:01






  • 1





    It works on Linux Mint 18. Thank you.

    – Hoang Tran
    Jul 17 '17 at 12:01






  • 1





    It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

    – MikeyE
    Sep 27 '17 at 18:34








  • 1





    Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

    – Per Lundberg
    Jul 8 at 13:32

















Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

– glts
Nov 13 '15 at 8:48





Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is.

– glts
Nov 13 '15 at 8:48













I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

– J.Serra
Apr 15 '16 at 14:01





I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works).

– J.Serra
Apr 15 '16 at 14:01




1




1





It works on Linux Mint 18. Thank you.

– Hoang Tran
Jul 17 '17 at 12:01





It works on Linux Mint 18. Thank you.

– Hoang Tran
Jul 17 '17 at 12:01




1




1





It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

– MikeyE
Sep 27 '17 at 18:34







It works for me on Debian 8 (Jessie). NOTE: I only tested the command line setxkbmap -option srvrkeys:none. I put the entry in a file in /etc/X11/Xsession.d/65srvrkeys-none. And while I haven't logged out and back in yet, I presume it will work just fine.

– MikeyE
Sep 27 '17 at 18:34






1




1





Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

– Per Lundberg
Jul 8 at 13:32





Worked fine for me on Debian Buster; like @MikeyE I haven't logged out yet (and will probably not do so in a couple of weeks/months ;-) but the setxkbmap approach did the trick. Much appreciated!

– Per Lundberg
Jul 8 at 13:32











1














You can disable this by going to System settings -> keyboard layout -> option.
under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".



I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... .
but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.






share|improve this answer




























  • You are right Ubuntu does not catch it, but I suspect that the X server does.

    – Jes
    Mar 26 '13 at 14:45






  • 3





    Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

    – o_nix
    Oct 30 '13 at 12:11


















1














You can disable this by going to System settings -> keyboard layout -> option.
under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".



I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... .
but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.






share|improve this answer




























  • You are right Ubuntu does not catch it, but I suspect that the X server does.

    – Jes
    Mar 26 '13 at 14:45






  • 3





    Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

    – o_nix
    Oct 30 '13 at 12:11
















1












1








1







You can disable this by going to System settings -> keyboard layout -> option.
under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".



I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... .
but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.






share|improve this answer















You can disable this by going to System settings -> keyboard layout -> option.
under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".



I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... .
but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 25 '13 at 7:09









manatwork

22.9k3 gold badges85 silver badges86 bronze badges




22.9k3 gold badges85 silver badges86 bronze badges










answered Mar 25 '13 at 6:16









rezamdarezamda

111 bronze badge




111 bronze badge
















  • You are right Ubuntu does not catch it, but I suspect that the X server does.

    – Jes
    Mar 26 '13 at 14:45






  • 3





    Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

    – o_nix
    Oct 30 '13 at 12:11





















  • You are right Ubuntu does not catch it, but I suspect that the X server does.

    – Jes
    Mar 26 '13 at 14:45






  • 3





    Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

    – o_nix
    Oct 30 '13 at 12:11



















You are right Ubuntu does not catch it, but I suspect that the X server does.

– Jes
Mar 26 '13 at 14:45





You are right Ubuntu does not catch it, but I suspect that the X server does.

– Jes
Mar 26 '13 at 14:45




3




3





Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

– o_nix
Oct 30 '13 at 12:11







Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7!

– o_nix
Oct 30 '13 at 12:11













0














In Ubuntu 18.04 you need to create the following file:



/usr/share/X11/xorg.conf.d/65-setxkbmap


with this content:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


then reboot your system.






share|improve this answer


























  • Except for the filename, this has been suggested in the accepted answer.

    – RalfFriedl
    May 11 at 21:16
















0














In Ubuntu 18.04 you need to create the following file:



/usr/share/X11/xorg.conf.d/65-setxkbmap


with this content:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


then reboot your system.






share|improve this answer


























  • Except for the filename, this has been suggested in the accepted answer.

    – RalfFriedl
    May 11 at 21:16














0












0








0







In Ubuntu 18.04 you need to create the following file:



/usr/share/X11/xorg.conf.d/65-setxkbmap


with this content:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


then reboot your system.






share|improve this answer













In Ubuntu 18.04 you need to create the following file:



/usr/share/X11/xorg.conf.d/65-setxkbmap


with this content:



Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection

Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection


then reboot your system.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 11 at 21:02









vort2020vort2020

1




1
















  • Except for the filename, this has been suggested in the accepted answer.

    – RalfFriedl
    May 11 at 21:16



















  • Except for the filename, this has been suggested in the accepted answer.

    – RalfFriedl
    May 11 at 21:16

















Except for the filename, this has been suggested in the accepted answer.

– RalfFriedl
May 11 at 21:16





Except for the filename, this has been suggested in the accepted answer.

– RalfFriedl
May 11 at 21:16


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f34158%2frebinding-disabling-ctrlaltf-virtual-terminal-console-switching%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m