From 0c524d538e56258a8665eee54fbab36e4c75a765 Mon Sep 17 00:00:00 2001 From: Sergio Dias Date: Sun, 26 Feb 2017 18:05:14 +0000 Subject: [PATCH] Added identifier settings for the desktops. --- README.md | 20 +++++++++++++ settings.ini | 54 ++++++++++++++++++++++++------------ virtual-desktop-enhancer.ahk | 19 +++++++++---- 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index db32568..f628c4a 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,26 @@ These are the available keyboard shortcut settings: | KeyboardShortcutsModifiers | NextTenDesktops | If doing any of the actions above and targetting a specific desktop (ex: Switch to desktop no. 3) it instead targets the desktop that comes 10 desktops after that one (ex: Switch to desktop no. 13 instead of no. 3). Note that this modifier is works together with the modifiers above. | | KeyboardShortcutsIdentifiers | PreviousDesktop | Do the action for the previous desktop. | | KeyboardShortcutsIdentifiers | NextDesktop | Do the action for the next desktop. | +| KeyboardShortcutsIdentifiers | Desktop1 | Do the action for desktop 1 (or desktop 11 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop2 | Do the action for desktop 2 (or desktop 12 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop3 | Do the action for desktop 3 (or desktop 13 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop4 | Do the action for desktop 4 (or desktop 14 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop5 | Do the action for desktop 5 (or desktop 15 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop6 | Do the action for desktop 6 (or desktop 16 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop7 | Do the action for desktop 7 (or desktop 17 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop8 | Do the action for desktop 8 (or desktop 18 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop9 | Do the action for desktop 9 (or desktop 19 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | Desktop10 | Do the action for desktop 10 (or desktop 20 if the key for "NextTenDesktops" is being pressed). | +| KeyboardShortcutsIdentifiers | DesktopAlt1 | Same as "Desktop1". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt2 | Same as "Desktop2". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt3 | Same as "Desktop3". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt4 | Same as "Desktop4". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt5 | Same as "Desktop5". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt6 | Same as "Desktop6". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt7 | Same as "Desktop7". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt8 | Same as "Desktop8". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt9 | Same as "Desktop9". Can be used as an alternative. | +| KeyboardShortcutsIdentifiers | DesktopAlt10 | Same as "Desktop10". Can be used as an alternative. | | KeyboardShortcutsCombinations | OpenDesktopManager | Open the desktop manager. | | KeyboardShortcutsCombinations | TogglePinWindow | Toggle pin on the current window. | | KeyboardShortcutsCombinations | TogglePinApp | Toggle pin on all of the windows of the currently opened app. | diff --git a/settings.ini b/settings.ini index 5a4283d..26945a9 100644 --- a/settings.ini +++ b/settings.ini @@ -3,15 +3,14 @@ DefaultDesktop=1 TaskbarScrollSwitching=1 UseNativePrevNextDesktopSwitchingIfConflicting=0 -[KeyboardShortcutsModifiers] -SwitchDesktop=Win, Ctrl -MoveWindowToDesktop= -MoveWindowAndSwitchToDesktop=Win, Ctrl, Shift -NextTenDesktops= - -[KeyboardShortcutsIdentifiers] -PreviousDesktop=Left -NextDesktop=Right +[Tooltips] +Enabled=1 +Centered=1 +FontSize=11 +FontColor=0xFFFFFF +FontInBold=1 +BackgroundColor=0x1F1F1F +Lifespan=750 [KeyboardShortcutsCombinations] TogglePinWindow=Win, Ctrl, Shift, Q @@ -23,14 +22,35 @@ UnpinApp= ; "SC029" is the key below your "Esc" key OpenDesktopManager=LAlt, SC029 -[Tooltips] -Enabled=1 -Centered=1 -FontSize=11 -FontColor=0xFFFFFF -FontInBold=1 -BackgroundColor=0x1F1F1F -Lifespan=750 +[KeyboardShortcutsModifiers] +SwitchDesktop=Win, Ctrl +MoveWindowToDesktop= +MoveWindowAndSwitchToDesktop=Win, Ctrl, Shift +NextTenDesktops= + +[KeyboardShortcutsIdentifiers] +PreviousDesktop=Left +NextDesktop=Right +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] 1= diff --git a/virtual-desktop-enhancer.ahk b/virtual-desktop-enhancer.ahk index bcfe991..4426728 100644 --- a/virtual-desktop-enhancer.ahk +++ b/virtual-desktop-enhancer.ahk @@ -133,12 +133,19 @@ setUpHotkeyWithCombo(combo, handler, settingPaths) { i := 0 while (i < 10) { - setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersSwitch, i, "OnShiftNumberedPress", "[KeyboardShortcutsModifiers] SwitchDesktop") - setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersMove, i, "OnMoveNumberedPress", "[KeyboardShortcutsModifiers] MoveWindowToDesktop") - setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersMoveAndSwitch, i, "OnMoveAndShiftNumberedPress", "[KeyboardShortcutsModifiers] MoveWindowAndSwitchToDesktop") - setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersSwitch, hkModifiersPlusTen, i, "OnShiftNumberedPressNextTen", "[KeyboardShortcutsModifiers] SwitchDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") - setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersMove, hkModifiersPlusTen, i, "OnMoveNumberedPressNextTen", "[KeyboardShortcutsModifiers] MoveWindowToDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") - setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersMoveAndSwitch, hkModifiersPlusTen, i, "OnMoveAndShiftNumberedPressNextTen", "[KeyboardShortcutsModifiers] MoveWindowAndSwitchToDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") + hkDesktopI0 := KeyboardShortcutsIdentifiersDesktop%i% + hkDesktopI1 := KeyboardShortcutsIdentifiersDesktopAlt%i% + j := 0 + while (j < 2) { + hkDesktopI := hkDesktopI%j% + setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersSwitch, hkDesktopI, "OnShiftNumberedPress", "[KeyboardShortcutsModifiers] SwitchDesktop") + setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersMove, hkDesktopI, "OnMoveNumberedPress", "[KeyboardShortcutsModifiers] MoveWindowToDesktop") + setUpHotkeyWithOneSetOfModifiersAndIdentifier(hkModifiersMoveAndSwitch, hkDesktopI, "OnMoveAndShiftNumberedPress", "[KeyboardShortcutsModifiers] MoveWindowAndSwitchToDesktop") + setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersSwitch, hkModifiersPlusTen, hkDesktopI, "OnShiftNumberedPressNextTen", "[KeyboardShortcutsModifiers] SwitchDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") + setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersMove, hkModifiersPlusTen, hkDesktopI, "OnMoveNumberedPressNextTen", "[KeyboardShortcutsModifiers] MoveWindowToDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") + setUpHotkeyWithTwoSetOfModifiersAndIdentifier(hkModifiersMoveAndSwitch, hkModifiersPlusTen, hkDesktopI, "OnMoveAndShiftNumberedPressNextTen", "[KeyboardShortcutsModifiers] MoveWindowAndSwitchToDesktop, [KeyboardShortcutsModifiers] NextTenDesktops") + j := j + 1 + } i := i + 1 }