Skip to content
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

Switching applications / windows in applications #151

Closed
Mahoney opened this issue May 5, 2020 · 5 comments
Closed

Switching applications / windows in applications #151

Mahoney opened this issue May 5, 2020 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Mahoney
Copy link
Contributor

Mahoney commented May 5, 2020

Asking as a question, because I'm not sure if it's a problem with my setup...

On Ubuntu 20.04 using a UK mac full wired keyboard (with numberpad) & kinto master as of commit e6db6a9 with xkeysnail.

Cmd-Tab & Shift-Cmd-Tab swaps applications as expected. However, Cmd-` (key to the left of z) does not switch windows within an application as it would on a Mac.

I looked into changing this manually, and bizarrely the Keyboard Shortcuts settings recognizes Cmd-` as Shift+Ctrl+Tools.

Looking in dconf-editor, I have the following:

switch-applications             ['<Primary>Tools', '<Alt>Tab']
switch-applications-backward    ['<Primary><Shift>Tools', '<Alt><Shift>Tab']
switch-group                    Default: ['<Super>Above_Tab', '<Alt>Above_Tab']
switch-group-backwards          Default: ['<Shift><Super>Above_Tab', '<Shift><Alt>Above_Tab']
cycle-group                     Default: ['<Alt>F6']
cycle-group-backwards           Default: ['<Shift><Alt>F6']

I tried playing around in dconf-editor using the following:

switch-applications             ['<Control>Tab']
switch-applications-backward    ['<Control><Shift>Tab']
switch-group                    []
switch-group-backwards          []
cycle-group                     ['<Control>grave']
cycle-group-backwards           ['<Control><Shift>grave']

cycle-group-backwards then works, but the others don't.

I presume there's some magic going on in GTK that remaps Control -> Primary when certain other keys are pressed? Or perhaps even maps Super -> Primary because it knows it's a mac keyboard, before the swapping of Super and Control is even registered? What's going on with the mapping of grave/` and tab to Tools with or without shift I haven't a clue...

Is there any way to disable all these synthetic keys like Primary, Tools and Above_Tab? It would make things considerably easier to reason about.

@Mahoney Mahoney added the question Further information is requested label May 5, 2020
@rbreaves
Copy link
Owner

rbreaves commented May 5, 2020

The Ctrl+Grave or Ctrl+` does need to be changed to window switching within a single app (although unless Catalina is different macOS does not switch within a single app like Linux does on that key).

The reason I back cycle on that key is that on macOS it does that but only after you press Cmd+Tab & that’s a hard thing to fully emulate.

The Tools remap is on purpose & intended to avoid complications & losing In-App tab switching. Ctrl-Tab by default changes tabs within a single app, & if you bind your App Switcher like you have now done then you will lose that.

That is why Tools is used, which is also known as F13 (for some reason binding to the “F13” key in xkeysnail maps to Tools - the Fn like keymap of F13, but it doesn’t matter. The point is to use a key you can’t normally map to so that conflicts will not possibly occur.).

It is a difficult thing to get right & balance out & yea it’ll look strange at first but all of it is working as intended, even though I’ve reconsidered Ctrl+` & will change its behavior to the more Linux “switch within an app” context. Later on if I can also emulate the Mac back cycling I will but not right now - it’s just not possible in xkeysnail today, but I have an issue ticket open with them to change that already.

@rbreaves
Copy link
Owner

rbreaves commented May 5, 2020

As far as using Primary.. I was probably just matching the default of what the OS sets for Control. If Control works in its place then great but I emulate what I can see the OS sets by default - not necessarily what makes things more readable for me. Interesting though that that works for you.

@rbreaves
Copy link
Owner

rbreaves commented May 5, 2020

Normally I'd redirect you to the ticket #44 for the Shortcut Translation Tables to make sense of it all, but I probably need to update that with the xkeysnail set. Xkeysnail has the ability to be more granular between Right and Left modifier keys btw and I make use of that. Some things may seem initially convoluted and crazy at first, but it is what you literally have to do as far as I can tell to not lose any OS or hotkey functionality while gaining mac like behaviors.

To sum it up more directly this is what is going on under GUI vs Term and I apologize if it is still difficult to follow, but from the best of my knowledge this is the best way I have found to handle the issue after weeks of working the problem and going through multiple iterations. @jonchun was also extremely helpful in helping me work it all out as KDE was very problematic on the xkb version of Kinto and is what led me to switching over to xkeysnail, although this keymap design really didn't change much - it just greatly improved the reliability of Cmd/Ctrl+Tab across the board to the point of it just always working.

GUI

App Switching
Left/Right Cmd + Tab → Right Control + Tab → Control + F13 (Tools) = Application Cycling
Left/Right Cmd + Shift + Tab → Right Control + Shift + Tab → Control + Shift + F13 (Tools) = Backwards Application Cycling
Left/Right Cmd + Shift + ` → Right Control + Shift + ` → Control + Shift + F13 (Tools) = Backwards Application Cycling

In-App Tab Switching
Ctrl + Tab → Super + Tab → Control + Tab = In-app tab switching
Ctrl + Shift + Tab → Super + Shift + Tab → Control + Shift + Tab = backwards In-app tab switching
Ctrl + Shift + ` → Super + Shift + ` → Control + Shift + ` = backwards In-app tab switching

Term

App Switching
Left/Right Cmd + Tab → Right Control + Tab → Control + F13 (Tools) = Application Cycling
Left/Right Cmd + Shift + Tab → Right Control + Shift + Tab → Control + Shift + F13 (Tools) = Backwards Application Cycling
Left/Right Cmd + Shift + ` → Right Control + Shift + ` → Control + Shift + F13 (Tools) = Backwards Application Cycling

In-App Tab Switching
Ctrl + Tab → Control + Page Down* = In-app tab switching
Ctrl + Shift + Tab → Control + Page Up* = backwards In-app tab switching
Ctrl + Shift + ` → Control + Page Up* = backwards In-app tab switching

  • These Page Up/Down keys may differ with the specific Terminal app, but this is the general keymap for most Terminals.

Additionally XFCE is an exception in that it does not map to F13 or Tools, at least not for GalliumOS (chromebooks), it ignores it so I have to use the backslash instead. I do not know if this holds true on a normal XFCE or Xubuntu install though. If anyone wants to test Kinto with more distros and DEs they are welcome to and I will accept PR requests.

@rbreaves rbreaves closed this as completed May 5, 2020
@rbreaves
Copy link
Owner

rbreaves commented May 5, 2020

I am reopening this ticket for now.. macOS even before catalina does in fact switch between similar apps on Cmd+`, so I will definitely be remapping that one properly in the next update.

@rbreaves rbreaves reopened this May 5, 2020
@rbreaves
Copy link
Owner

rbreaves commented May 6, 2020

This has been resolved. (The Cmd+` or Cmd+Tilde issue) The rest of it is working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants