Monday, May 22, 2023

ALT key not working on Windows 10 running in Virtualbox

I run Microsoft's Windows 10 as a Virtualbox Guest Machine from my Ubuntu 22.04 HOST.  I switched my Ubuntu 22.04 desktop to Cinnamon from Gnome.  The main reason I use the Windows 10 Virtual is to use Photoshop. 

Photoshop uses several shortcut keys, however when you run Windows 10 virtually, with Virtualbox, it honors some system keyboard shortcuts from your HOST system even when your using the virtual.  In my case Photoshop in Windows 10 uses the "ALT - Mouse (Left Click)"  keyboard shortcut for a lot of its functions.  Unfortunately Cinnamon also uses "ALT - Mouse (Left Click)" as a system keyboard shortcut for "Moving and Resizing Windows" and this Host System Keyboard Shortcut overrides your Virtual Guest making it impossible to use "ALT - Mouse (Left Click)" in Photoshop.

To fix this you need to change the HOST (Ubuntu's) "ALT - Mouse (Left Click)" keyboard shortcut to some other key/mouse combination.  The "ALT - Mouse (Left Click)" keyboard shortcut is assigned to  "Special key to move and resize windows option" by default in Ubuntu with Cinnamon Desktop (and on the Gnome desktop too).  To change the default keyboard/mouse shortcut do the following:

1. Click on your menu button and navigate to:
      MENU --> PREFERENCES --> SYSTEM SETTINGS 

2. Select the WINDOWS settings option.

3. Now select the BEHAVIOR tab.

4.  Finally under the "Moving and Resizing Windows" section;
     a. Select "Special key to move and resize windows option".
     b. Change the shortcut key to  <SUPER>. 

This will change your HOST's shortcut key from ALT Left-Click to SUPER Left-Click.  This mean that when you are in your virtual GUEST (Windows 10) the HOST (Ubuntu) setting will no longer over ride the "ALT - Mouse (Left Click)" keyboard shortcut and your ALT will now function as expected in your Guest OS. 


NOTE: This system shortcut key will also cause the same problem if your running GNOME Desktop too and the fix is the same but finding the shortcut assignments in Gnome will require a little google searching