-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added keyboard shortcuts to focus a specific window in a current workspace (#195) #662
base: main
Are you sure you want to change the base?
Conversation
this.connectTileableFocusChange(); | ||
} | ||
); | ||
const workspaceAdditionConnectionId = this.workspaceManager.connect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I havent't figured out any other way to determine that the extension is loaded and Me.msWorkspaceManager.getActiveMsWorkspace()
doesn't return undefined
. I tried using this.workspaceManager.get_active_workspace().connect('tileable-focus-changed'(...))
, but it only made the extension crash I believe.
this.lastStash = null; | ||
this.nextStash = null; | ||
connectTileableFocusChange() { | ||
this.tilableFocusChangeConnectionId = Me.msWorkspaceManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably could connect to 'focus-changed' event from Me.msWindowManager.msFocusManager
instead, which could made the code simpler I believe, but this event is not emitted for the "MsApplicationLauncher" (last tileable
- "+") and tileable-focus-changed
is. Is it a bug?
src/module/hotKeysModule.ts
Outdated
connectId: number; | ||
lastStash: number | null; | ||
nextStash: number | null; | ||
lastWorkspaceIndex: number | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed the variables to distinct them from the once I added.
The hotkeys just make possible to focus a specific window in a current workspace and I've aimed to make them basically work in the same manner as the ones for changing a workspace.
I've set them hotkeys to Ctrl + Super + <N> by default to avoid some collision, even though I personally use Super + <N> and changed the ones to switch workspace to Super + F<N>.
Moving the window to a specific index is not implemented yet. I believe it could be done within another Issue or at least in a different Merge Request.