Skip to content

Commit

Permalink
b/216743374 Change shortcut for leaving full-screen RDP (#609)
Browse files Browse the repository at this point in the history
Changing to Ctrl + Alt + F11, which:

* works on notebook keyboards (which lack a Break key)
* is more consistent with the F11 shortcut to enter full-screen
  • Loading branch information
jpassing authored Feb 10, 2022
1 parent 2c9f2b2 commit 91090b9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public class DocumentWindow : ToolWindow
/// back to main window.
/// </summary>
public const Keys ToggleFocusHotKey = Keys.Control | Keys.Alt | Keys.Home;

/// <summary>
/// Hotkey to enter full-screen.
/// </summary>
public const Keys EnterFullScreenHotKey = Keys.F11;

/// <summary>
/// Hotkey to leave full-screen.
/// </summary>
public const Keys LeaveFullScreenHotKey = Keys.Control | Keys.Alt | Keys.F11;


//
// Full screen form -- created lazily. There can only be one window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public ShellExtension(IServiceProvider serviceProvider)
_ => DoWithActiveRemoteDesktopSession(session => session.TrySetFullscreen(FullScreenMode.SingleScreen)))
{
Image = Resources.Fullscreen_16,
ShortcutKeys = Keys.F11
ShortcutKeys = DocumentWindow.EnterFullScreenHotKey
});
desktopMenu.AddCommand(
new Command<IMainForm>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ InstanceConnectionSettings settings
// the same as the main window uses to move the focus to the
// control.
//
// NB. The Ctrl+Alt are implied by the HotKeyFocusRelease properties.
// NB. The Ctrl+Alt modifiers are implied by the HotKeyFocusRelease properties.
//
Debug.Assert(ToggleFocusHotKey.HasFlag(Keys.Control));
Debug.Assert(ToggleFocusHotKey.HasFlag(Keys.Alt));
Expand All @@ -375,6 +375,15 @@ InstanceConnectionSettings settings
advancedSettings.HotKeyFocusReleaseLeft = focusReleaseVirtualKey;
advancedSettings.HotKeyFocusReleaseRight = focusReleaseVirtualKey;

//
// NB. The Ctrl+Alt modifiers are implied by the HotKeyFullScreen properties.
//
Debug.Assert(LeaveFullScreenHotKey.HasFlag(Keys.Control));
Debug.Assert(LeaveFullScreenHotKey.HasFlag(Keys.Alt));
var leaveFullScreenVirtualKey = (int)(LeaveFullScreenHotKey & ~(Keys.Control | Keys.Alt));

advancedSettings.HotKeyFullScreen = (int)leaveFullScreenVirtualKey;

this.connecting = true;
this.rdpClient.Connect();
}
Expand Down

0 comments on commit 91090b9

Please sign in to comment.