Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista 3 external keyboard - shortcut to switch tabs?
-
Just became a Pythonista 3 user, and so far greatly enjoying the app.
I'm trying an external bluetooth keyboard, but can't find any shortcut to switch tabs.
Are there any?
I was looking for something like CMD+TAB to switch to the previous opened tab, as found in most modern editors. It usually displays a list of opened tabs sorted by last accessed time.Currently I have to touch the tabs on the screen to switch, which breaks the flow if one is using an external keyboard.
I also found that holding CMD to display the keyboard shortcuts isn't working in Pythonista 3.
Hope this post can help improve the experience of using external keyboards on this already great app.
Thanks! -
Press and hold the command key to see the list of builtin commands.
There have also been some users who have hacked in their own commands. https://forum.omz-software.com/topic/3029/keyboard-shortcuts-physical
Disclaimer: I never use an external keyboard.
-
It's not possible.
These are all keyboard shortcuts implemented by the Pythonista editor (red section):
You could try to implement such functionality yourself but that'd be very difficult (I attempted to write such a script about a month ago but I couldn't work out how to programmatically change the selected tab. @omz any hints how to switch tab using
objc_util
?) -
everything is possible in objc!
https://gist.github.com/84ab564cf1ae26ce4ad100b103502b17
The tricky bit was figuring out that two methods seem to be required for switching a tab. One was discoverable via quering actionsForTarget_forControlEvent_(), with targets from .allTargets() and events from .allControlEvents() for the tabView. This returns a selector, whose name can be obtained from sel_getName.
The other I figured out mostly by guessing.Attaching these methods to keyboard shortcuts is left as an exercise for the reader( mostly available already in the forums)