Skip to content

Commit

Permalink
* fix switch desktop num
Browse files Browse the repository at this point in the history
  • Loading branch information
phazzzy committed Aug 28, 2020
1 parent 64e55c2 commit 6a06423
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
52 changes: 27 additions & 25 deletions settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,42 @@ PinWindow=
PinApp=
UnpinWindow=
UnpinApp=
; "SC029" is the key below your "Esc" key
; OpenDesktopManager=LAlt, SC029
ChangeDesktopName=Win, F2


[KeyboardShortcutsModifiers]
SwitchDesktop=Win
MoveWindowToDesktop=
MoveWindowAndSwitchToDesktop=Win, Ctrl, Shift
SwitchDesktopNum=Win, Ctrl
MoveWindowToDesktopNum=
MoveWindowAndSwitchToDesktopNum=
NextTenDesktops=
SwitchDesktopDir=Win, Ctrl
MoveWindowToDesktopDir=
MoveWindowAndSwitchToDesktopDir=Win, Ctrl, Shift


[KeyboardShortcutsIdentifiers]
PreviousDesktop=Left
NextDesktop=Right
Desktop1=0
Desktop2=1
Desktop3=2
Desktop4=3
Desktop5=4
Desktop6=5
Desktop7=6
Desktop8=7
Desktop9=8
Desktop10=9
DesktopAlt1=Numpad0
DesktopAlt2=Numpad1
DesktopAlt3=Numpad2
DesktopAlt4=Numpad3
DesktopAlt5=Numpad4
DesktopAlt6=Numpad5
DesktopAlt7=Numpad6
DesktopAlt8=Numpad7
DesktopAlt9=Numpad8
DesktopAlt10=Numpad9
Desktop1=1
Desktop2=2
Desktop3=3
Desktop4=4
Desktop5=5
Desktop6=6
Desktop7=7
Desktop8=8
Desktop9=9
Desktop10=0
DesktopAlt1=Numpad1
DesktopAlt2=Numpad2
DesktopAlt3=Numpad3
DesktopAlt4=Numpad4
DesktopAlt5=Numpad5
DesktopAlt6=Numpad6
DesktopAlt7=Numpad7
DesktopAlt8=Numpad8
DesktopAlt9=Numpad9
DesktopAlt10=Numpad0


[Wallpapers]
Expand Down Expand Up @@ -93,6 +92,7 @@ DesktopAlt10=Numpad9
9=
10=


[Icons]
1=
2=
Expand All @@ -105,6 +105,7 @@ DesktopAlt10=Numpad9
9=
10=


[RunProgramWhenSwitchingToDesktop]
1=
2=
Expand All @@ -117,6 +118,7 @@ DesktopAlt10=Numpad9
9=
10=


[RunProgramWhenSwitchingFromDesktop]
1=
2=
Expand Down
4 changes: 3 additions & 1 deletion virtual-desktop-enhancer.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ global TaskbarIDs := []
global TaskbarEdges := []
global previousDesktopNo := 0
global doFocusAfterNextSwitch := 0
global numberedHotkeys := 1
global numberedHotkeys := {}
global changeDesktopNamesPopupTitle := "Windows 10 Virtual Desktop Enhancer"
global changeDesktopNamesPopupText := "Change the desktop name of desktop #{:d}"

Expand Down Expand Up @@ -189,9 +189,11 @@ while (i <= numDesktops) {
}
i := i + 1
}

if (!(GeneralUseNativeDesktopSwitching && _IsPrevNextDesktopSwitchingKeyboardShortcutConflicting(hkModifiersSwitchDir, hkIdentifierPrevious))) {
setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersSwitchDir, hkIdentifierPrevious, "OnShiftLeftPress", "[KeyboardShortcutsModifiers] SwitchDesktopDir, [KeyboardShortcutsIdentifiers] PreviousDesktop")
}

if (!(GeneralUseNativeDesktopSwitching && _IsPrevNextDesktopSwitchingKeyboardShortcutConflicting(hkModifiersSwitchDir, hkIdentifierNext))) {
setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersSwitchDir, hkIdentifierNext, "OnShiftRightPress", "[KeyboardShortcutsModifiers] SwitchDesktopDir, [KeyboardShortcutsIdentifiers] NextDesktop")
}
Expand Down

7 comments on commit 6a06423

@Konfekt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also this feature to switch to the last desktop be merged? It is not perfect, but neither does it, say the more recent windows-desktop-switcher, perfectly.

@phazzzy
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I won't be able to merge this request, but I can implement the same functionality.

The idea is good, I often switch between two desktops. But about what they are standing next to, allows me to use the forward / backward arrows

@Konfekt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. It is indeed convenient to have an analog of Alt+Tab for virtual desktops, as implemented by many window managers.

@phazzzy
Copy link
Owner Author

@phazzzy phazzzy commented on 6a06423 Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

Hey @Konfekt, i did it! Not even a year has passed 😄

You can get it in b1fb925

@Konfekt
Copy link

@Konfekt Konfekt commented on 6a06423 Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great news! Thank you very much for adding this sorely missed hotkey function.

@Konfekt
Copy link

@Konfekt Konfekt commented on 6a06423 Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Awesome a common binding is Win + Escape to switch to the last Desktop.
This is preferrable to Win + 0, which collides with the binding to jump to the tenth virtual desktop.

@phazzzy
Copy link
Owner Author

@phazzzy phazzzy commented on 6a06423 Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I'll think about it again, thanks for the feedback

Please sign in to comment.