Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way that I can stop the Ctrl+Alt+F4 key combination from switching to a virtual terminal? I still want the other key combinations to switch to terminals - I just want to change the F4 one because I often use that keyboard shortcut in a Windows VM.

share|improve this question
    
You can use Host + F4 to issue a Ctrl + Alt + F4 for the VM (assuming VirtualBox) –  Lekensteyn Jun 23 '11 at 16:31
    
You might be able to remove tty4 from the getty list, but not sure it wouldn't push 5, 6, 7, etc. down. If you can live with 1 VT, your X server, and a log window, you can probably cram it all into F1, F2, F3. I forget the file you edit, that's why this is a comment. –  Broam Jun 23 '11 at 17:26
add comment

1 Answer

You can modify the keymap, with the following command:

xmodmap -pke | sed -n 's/ = .*VT_4.*/ = /p' | xmodmap -
share|improve this answer
    
Should this take effect immediately? –  Mario Jun 23 '11 at 22:09
    
Hmm, I executed this and ran xmodmap -pke | grep 'keycode\s*70' to verify it was gone. Ctrl-alt-F4 still switches to the terminal, and more interestingly, any time I switch to a TTY, the setting is reset. Please note, I ran the above in a gnome console window –  Mario Jun 23 '11 at 22:14
    
Uhm, it works for me. If disabled in the host, when executed in the guest it switch to the ubuntu guest vt4. If disabled also in the guest I have no effect at all. –  enzotib Jun 24 '11 at 5:42
    
I'm running Ubuntu 10.10 using compiz Window Manager. Not sure why this isn't working. –  Mario Jun 25 '11 at 14:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.