()
| 57 | nextStash: number | null; |
| 58 | |
| 59 | constructor() { |
| 60 | this.workspaceManager = global.workspace_manager; |
| 61 | this.settings = getSettings('bindings'); |
| 62 | this.actionIdToNameMap = new Map(); |
| 63 | this.actionNameToActionMap = new Map(); |
| 64 | this.lastStash = null; |
| 65 | this.nextStash = null; |
| 66 | |
| 67 | this.resetStash(); |
| 68 | this.connectId = global.window_manager.connect( |
| 69 | 'switch-workspace', |
| 70 | (_, from: number, _to: number) => { |
| 71 | if (this.lastStash !== null && from != this.lastStash) { |
| 72 | this.resetStash(); |
| 73 | } |
| 74 | } |
| 75 | ); |
| 76 | |
| 77 | this.actionNameToActionMap.set(KeyBindingAction.PREVIOUS_WINDOW, () => { |
| 78 | const msWorkspace = Me.msWorkspaceManager!.getActiveMsWorkspace(); |
| 79 | msWorkspace.focusPreviousTileable(); |
| 80 | }); |
| 81 | |
| 82 | this.actionNameToActionMap.set(KeyBindingAction.NEXT_WINDOW, () => { |
| 83 | const msWorkspace = Me.msWorkspaceManager!.getActiveMsWorkspace(); |
| 84 | msWorkspace.focusNextTileable(); |
| 85 | }); |
| 86 | |
| 87 | this.actionNameToActionMap.set(KeyBindingAction.APP_LAUNCHER, () => { |
| 88 | const msWorkspace = Me.msWorkspaceManager!.getActiveMsWorkspace(); |
| 89 | |
| 90 | msWorkspace.focusAppLauncher(); |
| 91 | }); |
| 92 | |
| 93 | this.actionNameToActionMap.set( |
| 94 | KeyBindingAction.PREVIOUS_WORKSPACE, |
| 95 | () => { |
| 96 | Me.msWorkspaceManager!.activatePreviousMsWorkspace(); |
| 97 | } |
| 98 | ); |
| 99 | |
| 100 | this.actionNameToActionMap.set(KeyBindingAction.NEXT_WORKSPACE, () => { |
| 101 | Me.msWorkspaceManager!.activateNextMsWorkspace(); |
| 102 | }); |
| 103 | |
| 104 | this.actionNameToActionMap.set(KeyBindingAction.LAST_WORKSPACE, () => { |
| 105 | const currentIndex = |
| 106 | this.workspaceManager.get_active_workspace_index(); |
| 107 | const lastIndex = this.workspaceManager.n_workspaces - 1; |
| 108 | if (currentIndex < lastIndex) { |
| 109 | Me.msWorkspaceManager!.primaryMsWorkspaces[ |
| 110 | lastIndex |
| 111 | ].activate(); |
| 112 | } |
| 113 | }); |
| 114 | |
| 115 | this.actionNameToActionMap.set( |
| 116 | KeyBindingAction.KILL_FOCUSED_WINDOW, |
nothing calls this directly
no test coverage detected