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.
Keyboard shortcuts (Physical)
-
I have been wanting to add new keycommands to pythonista so that I can navigate the ui with less touching of the screen, so this one is probably aimed at @omz more as it is a question about internals to pythonista.
I can happily add keycommands to the app, but @omz, if you are happy to share or even if it is possible, I am looking for a way to open the "new file" view by using a keycommand as well as show/hide the file browser list. Do you have any pointers to where I should look for these?
-
https://github.com/jsbain/objc_hacks/blob/master/addnewfileshowchooser.py
not entirely clean, but should be usable. show_file_chooser_panel shows the file chooser, optionslly creating a new tab first. add_new_file is equivalent to clicking the new tab button, then clicking the new file button on the resulting empty tab.
I feel like there might be a better way to show the editor, console.hide_output requires the annoying time.sleep which might not be robust (for instance, if the editor has a large file) e
-
Thanks @JonB I have taken a couple of your scripts and created a script that adds physical keyboard shortcuts to create a new tab, show the new file dialog and show/hide the filebrowser. GitHub link
This has been barely tested and you can't use a method with a name with an _ in it.
-
@JonB I am hoping you can help, the script I created a while ago that based on your keycommands script no longer works (yours doesn't either). I now get this error
AddKeyCommands.py", line 64, in addKeyCommandToPythonista
aa = getattr(CmdHHandler_obj, me.__name__).method
AttributeError: 'ObjCInstanceMethodProxy' object has no attribute 'method'I cant work out how to fix it. If you can take a look that would be fantastic.
-
I plan on adding this feature to my objc_tools lib like many other features.
-
http://nshipster.com/uikeycommand/ Seems subclasses need to be able to become first responders
-
The correct way to get an instance method IMP in recent versions is
aa = ObjCInstanceMethod(CmdHHandler_obj, me.__name__).method
Use that on line 64
-